wiki:HowToReportABug/GenerateBacktrace
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": libapr-1.so.0: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.

Version 2 (modified by moo, 7 years ago) (diff)

--

Generating a Backtrace

If you don't have a core file yet

Read generating a Backtrace on php.net.

  • config xcache.coredump_directory in /etc/php.ini
  • Ensure that the xcache.coredump_directory has write permissions for the user who's running PHP.
  • Remove any limits you may have on core dump size from your shell:
    • tcsh: unlimit coredumpsize
    • bash/sh: ulimit -c unlimited
  • Cause PHP to crash:
    • PHP CGI: Simply run php with the script that crashes it
    • PHP FastCGI: Simply setup normal webserver-fastcgi configuration, and access the script that crashes PHP
    • PHP As Apache Module: Run httpd -X, and access the script that crashes PHP

Once you have the core file

check where the coredump is

$ grep xcache.coredump_directory /etc/php.ini
xcache.coredump_directory = "/tmp/"
$ ls /tmp/core
/tmp/core

ok, it's there

  • PHP as CGI/FastCGI: Run gdb with the path to the PHP or PHP-enabled httpd binary, and path to the core file, for example:
    $ gdb /usr/local/bin/php-cgi-fcgi /tmp/core  
    ........
    (gdb) bt 
    (gdb) source ~/src/php5/.gdbinit 
    (gdb) dump_bt
    
  • PHP As Webserver Module: Run gdb with the path to the PHP or PHP-enabled httpd binary, and path to the core file, for example:
    $ gdb /usr/local/apache/sbin/httpd /tmp/core 
    ........
    (gdb) bt 
    (gdb) source ~/src/php5/.gdbinit
    (gdb) dump_bt