[xdebug-general] Re: Function trace problem

From: Richard Lynch <rlynch[@]peak6.com>
Date: Tue, 26 Aug 2008 10:18:31 -0500

When a callback is "registered" down in the guts of PHP C source code, with something like session_set_save_handler (or whatever it's called), the __FILE__:__LINE__ etc are not stored with it: Just a "function pointer" sort of thing.

So PHP has no real idea where this function was defined.

Actually, I guess it IS storing the file name, but not the line number...

The message USED to be "in file 'Unknown' on line 0", so somebody decided that was not good enough and fixed it.

You could probably submit a patch that would store line number as well with reasonable expectation that it would go through -- Though there may be some technical reason why the line number is "hard" to get/store.

> -----Original Message-----
> From: xdebug-general-bounce[@]lists.xdebug.org [mailto:xdebug-general-
> bounce[@]lists.xdebug.org] On Behalf Of Silas F. Johansen
> Sent: Tuesday, August 26, 2008 6:09 AM
> To: xdebug-general[@]lists.xdebug.org
> Subject: [xdebug-general] Function trace problem
>
> Hello,
>
> 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?
>
> I'd much appreciate any thoughts on this. If there's any relevant info
> I didn't include please ask.
>
> Regards,
> Silas

_______________________________________________________

The information in this email or in any file attached
hereto is intended only for the personal and confiden-
tial use of the individual or entity to which it is
addressed and may contain information that is propri-
etary and confidential. If you are not the intended
recipient of this message you are hereby notified that
any review, dissemination, distribution or copying of
this message is strictly prohibited. This communica-
tion is for information purposes only and should not
be regarded as an offer to sell or as a solicitation
of an offer to buy any financial product. Email trans-
mission cannot be guaranteed to be secure or error-
free. P6070214
Received on Tue Aug 26 2008 - 17:35:43 BST

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