- 论坛徽章:
- 0
|
[php]\r\n/* handle all varieties of core dumping signals */\r\nstatic void sig_coredump(int sig)\r\n{\r\n apr_filepath_set(ap_coredump_dir, pconf);\r\n apr_signal(sig, SIG_DFL);\r\n#if AP_ENABLE_EXCEPTION_HOOK\r\n run_fatal_exception_hook(sig);\r\n#endif\r\n /* linuxthreads issue calling getpid() here:\r\n * This comparison won\'t match if the crashing thread is\r\n * some module\'s thread that runs in the parent process.\r\n * The fallout, which is limited to linuxthreads:\r\n * The special log message won\'t be written when such a\r\n * thread in the parent causes the parent to crash.\r\n */\r\n if (getpid() == parent_pid) {\r\n ap_log_error(APLOG_MARK, APLOG_NOTICE,\r\n 0, ap_server_conf,\r\n \"seg fault or similar nasty error detected \"\r\n \"in the parent process\" ;\r\n /* XXX we can probably add some rudimentary cleanup code here,\r\n * like getting rid of the pid file. If any additional bad stuff\r\n * happens, we are protected from recursive errors taking down the\r\n * system since this function is no longer the signal handler GLA\r\n */\r\n }\r\n kill(getpid(), sig);\r\n /* At this point we\'ve got sig blocked, because we\'re still inside\r\n * the signal handler. When we leave the signal handler it will\r\n * be unblocked, and we\'ll take the signal... and coredump or whatever\r\n * is appropriate for this particular Unix. In addition the parent\r\n * will see the real signal we received -- whereas if we called\r\n * abort() here, the parent would only see SIGABRT.\r\n */\r\n}\r\n[/php] |
|