[xdebug-general] Re: XDebug Segfault Capabilities

From: Brian Shire <shire[@]php.net>
Date: Thu, 21 Sep 2006 11:09:44 -0700

FYI, I use the following commands on a core file to pull down php
specific information... ie: gdb <binary> -c <corefile> -x
<gdbscriptbelow>

echo \n
echo \n
echo ----------------------------- C level backtrace
------------------------------------------\n
echo \n
bt
echo \n
echo
------------------------------------------------------------------------
-------------------\n
echo \n
echo Attempting to fetch the current function: \n\n
echo function state \n
print (char *)(executor_globals.function_state_ptr->function)-
>common.function_name
echo \n
echo active op function \n
print (char *)executor_globals.active_op_array->function_name
echo \n
echo \n
echo
------------------------------------------------------------------------
---------------------\n
echo Attempting to fetch the PHP filename and line number this
occured in: \n
echo \n
echo Compiling On line \n
print compiler_globals->compiled_filename
print compiler_globals->zend_lineno
echo \n
echo Executing On line \n
print (char *)executor_globals.active_op_array->filename
print executor_globals.opline_ptr->lineno
echo
------------------------------------------------------------------------
---------------------\n
echo Attempting to pull down PHP level backtrace: \n
echo \n
set $execute_data = executor_globals->current_execute_data

while $execute_data != 0
print $execute_data->function_state->function.common.function_name
set $execute_data = $execute_data->prev_execute_data
end

quit

On Sep 21, 2006, at 10:53 AM, Erik Osterman wrote:

> Hi,
>
> I'm tearing my hair out trying to solve a certain segmentation
> fault in one of my PHP5 server (i.e. non-cgi) applications. The
> application has grown to the point where not having a comprehensive
> debugger is a real pain. The pain, however, isn't that that I can't
> figure out what causes some exception; the pain is that I can't
> figure out what causes (from the PHP perspective) particular
> segfaults. In the past couple months I've had to tackle countless
> segfaults, mostly due to PHP 5's broken (IMHO) reference
> implementation (the fix in my cases have usually been to clone a
> particular object). Now I'm stuck and at my wits end. Without being
> more familiar with the PHP internals, gdb is of limited usefulness.
>
> Can XDebug correlate lines of php code to a segfault much like gdb
> with C code? Or is it only useful for tracking down exceptions and
> errors not related to segfaults? The latter being my expectation.
>
> Either way, if anyone has advice on tracking down segfaults related
> to PHP applications I'd appreciate hearing from you. Unfortunately,
> I have no way of creating "reproduce" code and must therefor tackle
> this on my own.
>
>
> Best Regards,
>
> Erik Osterman
>
>
Received on Thu Sep 21 2006 - 20:09:54 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST