PHP5 coredumps

Voltar

Active Member

Reaction score: 24
Messages: 191

So I just went and upgraded PHP and some extensions only to end up with it doing nothing but segfaulting. Unfortunately it never actually dumps a core, so I have nothing to examine in gdb, and I'm not that good with gdb anyways, trying to invoke it with the program doesn't do anything. Is there an easy way to force a coredump on a process that segfaults instantly?

For what it's worth, I already know that the memory in the box is good, and I do have coredumps enabled. I've also searched the entire drive for core.* files and nothing turns up.

Code:
[root@router /usr/local/bin]# php
Segmentation fault: 11 (core dumped)
^^ that's what it does, doubt that it's any help.
 

danger@

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 368
Messages: 993

best thing to do would be to remove the whole php installation and start from scratch...
 

Christopher

Member

Reaction score: 15
Messages: 57

I've seen that happen when /usr/local/etc/php/extensions.ini is out of order, or loading an incompatible set of extensions. Some php extensions define symbols that clobber symbols in previously loaded extensions.

To diagnose it, comment out each line in extensions.ini one by one while running php to track the culprit down. Once you've discovered the extension that is making php segment fault, try moving that extension to the beginning or the end of extensions.ini.
 
OP
OP
V

Voltar

Active Member

Reaction score: 24
Messages: 191

This is a little bit of a late reply, but I finally had time to upgrade my router to 7.2, and decided to tackle this again. After trying commenting the extensions out one by one to no avail, I did some backtraces on the core dumps and Google'ing the results. Finally it led me to this PHP bug, which talked about issues with the php recode extension and of course, the order loaded. Since I didn't need recode (and don't know how it got there in the first place), I went ahead and removed it, backed up my extensions.ini and went ahead and recompiled PHP and all the extensions again for good measures. Works beautifully now.

Just wanted to share in case anyone runs into a similar problem.
 

gedge

New Member

Reaction score: 5
Messages: 17

pgsql.so was the culprit for me (moving it didn't work, commenting it out did)
 
Top