Debugging PHP core files - No symbol "executor_globals" in current context
I'm trying to get a backtrace from a core file generated by PHP.
I'm following this guide and when I try to print the name of a function using:
开发者_运维百科print (char *)(executor_globals.function_state_ptr->function)->common.function_name
I get the error:
No symbol "executor_globals" in current context.
I'm running GDB with:
gdb /usr/sbin/apache2 /mnt/cores/core.apache2.8315
Interestingly, I don't have this problem when using the libapache2-mod-php5 package on Ubuntu. I had to compile my own PHP module to fix a different problem and it's this compiled module that's giving me the trouble.
A google search for "no symbol executor_globals" actually returns 0 results, which I find pretty strange. Am I seriously the only person to ever have this problem?
I ended up solving this by compiling PHP against a non-threaded Apache, effectively disabling thread safety in the PHP module which is what I wanted anyway.
More specifically, the apxs2 binary I was specifying in the configure args was from the Ubuntu apache2-threaded-dev package, while the Apache running on the server was prefork, not threaded. So I just had to install the apache2-prefork-dev package instead and recompile and I was good to go.
精彩评论