[xdebug-general] Re: Function trace problem

From: Derick Rethans <derick[@]xdebug.org>
Date: Tue, 26 Aug 2008 13:34:09 +0200 (CEST)

On Tue, 26 Aug 2008, Silas F. Johansen wrote:

> I'm trying to use XDebug to help figure out the structure of an LMS
> (Customized version of Ilias 3.5 from http://ilias.de/) that I'm
> currently trying to get to run on my machine. Browsing the log I find
> that many function calls seem to be made from line number 0 (zero) of
> the file where the function in question is defined/declared. Is this
> the intended behavior, because normally I would expect to find the
> filename and line number from where such a function was called?
>
> Some details:
> Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch Server at sfj-dt Port 80
>
> Currently, I get this error message when viewing the log-in page in my browser:
> ( ! ) Fatal error: Call to a member function query() on a non-object in /var/www/sfj/ssi/ilias3/include/inc.db_session_handler.php on line 91
> Call Stack
> # Time Memory Function Location
> 1 0.9051 7255728 db_session_write( ) ../inc.db_session_handler.php:0
>
> I'm not particularly worried about the error as I believe I can figure
> out how to fix it once I figure out from where db_session_write is
> called. Figuring that out is difficult when the relevant line of log
> looks like this, though:
>
> $ grep db_session_write /tmp/trace.2043925204.xt
> 0.9051 7255728 -> db_session_write() /var/www/sfj/ssi/ilias3/include/inc.db_session_handler.php:0
>
> Now, when I test this using a simple, two-file project where one file
> containing a function (xdbtest()) is require_once()'d from the other
> and the function then called I get what I expect:
>
> $ cat /tmp/trace.2043925204.xt
> TRACE START [2008-08-26 11:06:21]
> 0.0001 53264 -> {main}() /var/www/sfj/t1.php:0
> 0.0002 54724 -> require_once(/var/www/sfj/t2.php) /var/www/sfj/t1.php:2
> 0.0003 54524 -> xdbtest() /var/www/sfj/t1.php:4
> 0.0004 24476
> TRACE END [2008-08-26 11:06:21]
>
> I can easily see from where the call to xdbtest() was made.
>
> I'm having trouble understanding why - is this the intended behavior
> of XDebug, a misconfiguration issue on my box, a bug, or something
> else that I haven't thought of?

To me it looks like a user-defined session module is used. There should
only really be *one* top level function call in the trace file. If this
is not the case, it's very likely that the function that shows up was
called from withing a special PHP callback function - in this case the
user implementation of the session_close method of a user defined
session handler. I can't however be sure as you didn't show enough of
your trace file -- please put it online somewhere.

regards,
Derick

-- 
Like Xdebug? Send a postcard: http://derickrethans.nl/xdebug_2_released.php
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Tue Aug 26 2008 - 13:34:09 BST

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