Page 1 of 1

can't create core dump file

Posted: Thu Mar 25, 2004 10:48 am
by allelopath
I am trying to create a core dump file in order to submit a PHP bug
I am following instructions at:
http://bugs.php.net/bugs-generating-backtrace.php

i configure for debug and then build
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --enable-debug > configureOutput.txt
# make
# make install
# libtool --finish /usr/local/php-5.0.0RC1/libs

i remove limits on core dump size from shell
# ulimit -c unlimited

I open all permissions to /usr/local/apache/bin/
# chmod 777 /usr/local/apache/bin

then run httpd
cd /usr/local/apache/bin
#./httpd -X

Then i access a php page

"Segmentation Fault" appears in the shell (this is the error i'm trying to trace), but I should see a file name 'core' in /usr/local/apache/bin
but I don't

If i then follow the instructions for "If you can't get a core file", i get the message:
Couldn't get registers: Operation not permitted.

What can i do to get a core dump file?

Posted: Fri Mar 26, 2004 4:45 am
by Pyrite
This is a bug in the 2.4 Kernel that disables core dumps in programs that have changed user id's like httpd. This is supposedly fixed in the Apache 2.0, but you can also get an apache module called mod_prctl which will enable core dumps on apache again without having to recompile apache. Good luck.

Posted: Fri Mar 26, 2004 3:03 pm
by allelopath
ok, thanks, i've actually discovered the problem i was trying to trace thru other ways, but next tiime i need to do this, i know

Posted: Fri Mar 26, 2004 5:53 pm
by Pyrite
Yea, I was going to say using gdb or strace would be easier, but dunno if the php guys would want the backtraces of those.