Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14013897
D7797.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.diff
View Options
Index: scripts/__init_script__.php
===================================================================
--- scripts/__init_script__.php
+++ scripts/__init_script__.php
@@ -65,6 +65,22 @@
require_once $root.'/src/__phutil_library_init__.php';
PhutilErrorHandler::initialize();
+
+ // If possible, install a signal handler for SIGHUP which prints the current
+ // backtrace out to a named file. This is particularly helpful in debugging
+ // hung/spinning processes.
+ if (function_exists('pcntl_signal')) {
+ pcntl_signal(SIGHUP, '__phutil_signal_handler__');
+ }
+}
+
+function __phutil_signal_handler__($signal_number) {
+ $e = new Exception();
+ $pid = getmypid();
+ // Some phabricator daemons may not be attached to a terminal.
+ Filesystem::writeFile(
+ sys_get_temp_dir().'/phabricator_backtrace_'.$pid,
+ $e->getTraceAsString());
}
__phutil_init_script__();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 3, 6:46 PM (1 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6732240
Default Alt Text
D7797.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