]> granicus.if.org Git - apache/commitdiff
fix a problem where a crash of a non-MPM child process could
authorJeff Trawick <trawick@apache.org>
Thu, 11 Dec 2003 19:05:30 +0000 (19:05 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 11 Dec 2003 19:05:30 +0000 (19:05 +0000)
result in an error log message stating that the parent had
crashed

the problem, which affected all *X platforms, was due to an
attempt to support the general problem with linuxthreads;
this change leaves us with a relatively obscure hole when
running on linuxthreads (see comments)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102033 13f79535-47bb-0310-9956-ffa450edef68

server/mpm_common.c

index efaceaa7394fb1b2237b1c63f11b4a6ad2fe8401..f28ba746027cd9e07935d18274762eb8b8ff5cac 100644 (file)
@@ -948,7 +948,14 @@ static void sig_coredump(int sig)
 #if AP_ENABLE_EXCEPTION_HOOK
     run_fatal_exception_hook(sig);
 #endif
-    if (my_pid == parent_pid) {
+    /* linuxthreads issue calling getpid() here:
+     *   This comparison won't match if the crashing thread is
+     *   some module's thread that runs in the parent process.
+     *   The fallout, which is limited to linuxthreads:
+     *   The special log message won't be written when such a
+     *   thread in the parent causes the parent to crash.
+     */
+    if (getpid() == parent_pid) {
         ap_log_error(APLOG_MARK, APLOG_NOTICE,
                      0, ap_server_conf,
                      "seg fault or similar nasty error detected "