Homec4science

Added a SIGABRT handler that will write a stack trace to…

Authored by William R. Otte <wotte@isis.vanderbilt.edu> on Dec 19 2013, 02:38.

Description

Added a SIGABRT handler that will write a stack trace to /tmp/phabricator_backtrace_[PID]

Summary:
Stack traces are useful for debugging things. This adds a
signal handler that registers SIGABRT and SIGHUP. In both cases, a
backtrace is written to /tmp/phabricator_backtrace_<PID>. If SIGABRT
is caught, we terminate the process with extreme prejudice.

Note, however, that any php script that wishes to actually use this
functionality must declare(ticks=1) (or some other value) in the main
script; i.e., setting this value in an included script doesn't appear
to impact the main script.

Test Plan:
<?php
declare(ticks=1);
require_once ('__init_script__.php');
posix_kill(posix_getpid(), SIGABRT);
sleep (1000000);
?>

for both SIGABRT and SIGHUP, did the same with kill -ABRT and kill -HUP.
Observed that it worked as intended.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7797

Details

Committed
epriestley <git@epriestley.com>Dec 19 2013, 02:39
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUd464f545b1ab: Make all "protected" in ExecFuture into "private"
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU5d7dc5cb30dd: Added a SIGABRT handler that will write a stack trace to… (authored by William R. Otte <wotte@isis.vanderbilt.edu>).Dec 19 2013, 02:39