Page MenuHomePhabricator

phd causes segmentation faults
Closed, InvalidPublic


When running commands on phd, I get unexpected results that usually end in a segmentation fault. The results seem to be random, sometimes they fail right away and sometimes they work for a while and then fail. Other times I'll run phd start and it will never exit, it just seems to hang. I get the warning message every time.

I'm not sure what information to provide, so whatever you need to help debug let me know and I can get it. I'm running this on an OS X 10.10.5 machine running MAMP. MAMP is running php 5.6.10 and the system installed php is 5.5.28. I installed pcntl on the system php using Homebrew.

$ phd start
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0

Warning: Module 'pcntl' already loaded in Unknown on line 0
Freeing active task leases...
Freed 0 task lease(s).
Launching daemons:
(Logs will appear in "/var/tmp/phd/log/daemons.log".)

    PhabricatorRepositoryPullLocalDaemon (Static)
    PhabricatorTriggerDaemon (Static)
    PhabricatorTaskmasterDaemon (Autoscaling: group=task, pool=4, reserve=0)

Segmentation fault: 11
$ phd status
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0

Warning: Module 'pcntl' already loaded in Unknown on line 0
Log Daemon       Host      Overseer Started                Class                                Arguments
4   53462:uc5rag localhost 53462    Sep 3 2015, 1:19:31 PM PhabricatorRepositoryPullLocalDaemon 
5   53462:hp6mx7 localhost 53462    Sep 3 2015, 1:19:31 PM PhabricatorTriggerDaemon             
6   53462:dfwtwu localhost 53462    Sep 3 2015, 1:19:31 PM PhabricatorTaskmasterDaemon  

Here's an example where it spun up the fans and never completed beyond this point:

$ phd stop
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0

Warning: Module 'pcntl' already loaded in Unknown on line 0
Interrupting process 53462...
Process 53462 exited.

Once this happens the only way I can get it to exit is to close the terminal window, none of the break keys work.

Event Timeline

ReturnZero updated the task description. (Show Details)
ReturnZero added a project: Daemons.
ReturnZero added a subscriber: ReturnZero.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

I can't reproduce this on any of the systems I have access to (although none are replicas of your system) and, in general, there is nothing Phabricator should be able to do in PHP to cause a process to segfault (except maybe willfully sending ourselves signals). With very rare exception, segfaults are caused by PHP itself or an extension, not by us. I also haven't seen other reports of anything similar.

The warning PHP is emitting about extension misconfiguration may point at the root problem. Particularly, one of the native/brew/MAMP PHP binaries might be loading extensions compiled for another one?

If you can reproduce this on a vanilla setup that doesn't have three separate PHP installs we can spend more time looking at it, but this is almost certainly an issue specific to your environment which only affects you. We don't have the resources to help individual users with environmental problems of their own making, see:

I suspect that this issue can not be reproduced outside of your environment and that the root issue is with MAMP, brew, or PHP, or lies in the middle ground between the three systems somehow.

Thanks for looking into this for me. I ended up totally re-installing everything manually (or not really manually but using Homebrew) and that seemed to work much better. Something about MAMP must have been causing all kinds of problems.

Probably not a big deal that you didn't find anything, I'm guessing most people who are running Phabricator aren't doing so using MAMP.