Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13255673
D7797.id17638.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
894 B
Referenced Files
None
Subscribers
None
D7797.id17638.diff
View Options
Index: scripts/__init_script__.php
===================================================================
--- scripts/__init_script__.php
+++ scripts/__init_script__.php
@@ -1,6 +1,25 @@
<?php
+function phabricator_sigabrt_handler($signal_number) {
+ $e = new Exception ();
+ $pid = posix_getpid ();
+ // Some phabricator daemons may not be attached to a terminal.
+ $outfile = fopen ('/tmp/phabricator_backtrace_' . $pid, 'w');
+ fwrite ($outfile, $e->getTraceAsString());
+
+ switch ($signal_number) {
+ case SIGABRT:
+ exit (-1);
+ break;
+ }
+}
+
function init_phabricator_script() {
+ if (!pcntl_signal (SIGABRT, "phabricator_sigabrt_handler") ||
+ !pcntl_signal (SIGHUP, "phabricator_sigabrt_handler")) {
+ echo "WARNING: Unable to register signal handler for SIGABRT or SIGHUP\n";
+ }
+
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 26, 6:51 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6308591
Default Alt Text
D7797.id17638.diff (894 B)
Attached To
Mode
D7797: Added a SIGABRT handler that will write a stack trace to /tmp/phabricator_backtrace_[PID]
Attached
Detach File
Event Timeline
Log In to Comment