View Issue Details

IDProjectCategoryView StatusLast Update
0000676XdebugUsage problems (Wrong Results)public2014-06-14 10:33
ReportertreblyAssigned Toderick 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionno change required 
PlatformPCOSWin XP OS VersionSP3
Product Version 
Target VersionFixed in Version 
Summary0000676: Xdebug : unable to xdebug_start_trace - no explanation no roadmap to find
DescriptionHi,
I launch a trac as I use. Just enhance the preparation checks and setups.

I had never this I don't how to search the solution.

I made a detailed test :
fopen($file, a+);
fclose($file);
 xdebug_start_trace($file, 7) // as usual
I get the error (with or not the file test file existing or not) I don't known at all any roadmap to solve such a problem
error message :
Trace could not be started in <$.php at line x>

So It is probably a documentation problem, but tiny and sharp.
Nervertheless I am stopped in my job.

note: configuration tested on other projects.
Steps To ReproduceNo one on your system but just :
1- Direct access to the url to see the display
2- Teamviewer 6
Additional InformationNot present during 8 days from now.

xdebug configuration in php.ini (large model) :

;Xdebug
;zend_extension = "${path}\xdebug\php_xdebug-2.1.0-5.3-vc6.dll"
zend_extension = "e:\program files\easyphp-5.3.4.0\xdebug\php_xdebug-2.1.0-5.3-vc6.dll"

;xdebug.default_enable=Off

xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart = false

xdebug.dump_globals=1
xdebug.dump=COOKIE,FILES,GET,POST,REQUEST,SERVER,SESSION
xdebug.dump.SERVER=REMOTE_ADDR,REQUEST_METHOD,REQUEST_URI

xdebug.show_local_vars=1
xdebug.show_mem_delta=1

xdebug.collect_includes=1
xdebug.collect_vars=1
xdebug.collect_params=4
xdebug.collect_return=1

xdebug.auto_trace=0
xdebug.trace_options=0
; for profiler
xdebug.trace_format=1
; xdebug.trace_output_dir="${path}\xdebug\trace"
xdebug.trace_output_dir="g:\program files\easyphp-5.3.5.0\xdebug\trace"
xdebug.trace_output_name="trace.%t"

; Set B10226
xdebug.profiler_enable=0
xdebug.profiler_append=0
xdebug.profiler_enable_trigger=0
; xdebug.profiler_output_dir="${path}\xdebug\profiler"
xdebug.profiler_output_dir="G:\Trebly\__xdebug-profiler"
; it seems a bug if two options are set .xt is not put at the end of the name
xdebug.profiler_output_name="cachegrind.out.%s.%t.xt"


xdebug.collect_assignments=1
xdebug.show_exception_trace=1
xdebug.var_display_max_data=40000
xdebug.var_display_max_depth=5
xdebug.var_display_max_children=2048


TagsNo tags attached.
Operating System
PHP Version5.3.6

Activities

trebly

2011-04-10 20:47

reporter   ~0001718

Last edited: 2011-04-10 20:49

View 2 revisions

I Test today to launch lonely
xdebug_start_trace(). This runs OK

So the problem seems to come from the file name. The sequences
fopen($file, a+);
fclose($file);
xdebug_start_trace($file, 7)
lead to the error.
Even in this test the file $file exist (with the right name) xdebug_start_trace should overwrite it ( a file with the right name is generated).

I will may be find the solution, but I do think that this error on the file could be reported, because there are many reason not to be able to xdebug_start_trace could fail.

I think that if the problems find a solution here it must be sent to quality to get a better error message.

derick

2011-04-11 09:31

administrator   ~0001719

Could you show me a working script that shows the problem. The last note's code clearly makes no sense. Please include all filenames/directory names as well. And run it with:

strace php yourSmallScript.php 2>/tmp/strace.log

and please attach strace.log to this bug as well.

trebly

2011-04-13 00:08

reporter   ~0001723

OK it was shortened. In fact I simply open and close the file to test the validity of the name and the rights before launching xdebug.
As the file
1- is correctly opened and closed
2- when I use the default parameters xdebug_start_trace() the trace runs
 
The problem comes from xdebug

The full code id a little long because of the check up of xdebug context. So I have not submitted to earn time.

I made the test using a full name of the file (get the realpath of the subdir) and concat with the file name. It runs normally.

Looking at the xdebug error table (with the error case) I found that the name of the file was not right :

the name is "__trac/xd/<name>" the name doesn't matters.

The table contains xdebug_start_trace(" trac/xd/<name>)

So I think that if the relative name begins with chars "_" they are truncated or replaced by blanks. This generates the error.

So a test code should be

$subdir="__trac\xd\";
$file="sample.htm";
$ft=fopen($subdir.$file,'a+');
fclose($ft);
xdebug_start_trace($subdir.$file, 7) ; // This crashes : cannot run...

While

$subdir="__trac\xd\";
$file="sample.htm";
$realpsubdir=realpath($subdir);
$ft=fopen($subdir.$file,'a+');
fclose($ft);
xdebug_start_trace($realpsubdir.$file, 7) ; // Is OK

It seems well that the problem comes from the subdir name.

derick

2014-05-19 23:09

administrator   ~0002816

Is this still a problem with the latest version of xdebug?

derick

2014-06-14 10:33

administrator   ~0002849

Unable to reproduce, and no feedback provided. I'm closing this out, but feel free to reopen if you can provide the requested information.

Issue History

Date Modified Username Field Change
2011-04-04 01:51 trebly New Issue
2011-04-10 20:47 trebly Note Added: 0001718
2011-04-10 20:49 trebly Note Edited: 0001718 View Revisions
2011-04-11 09:31 derick Note Added: 0001719
2011-04-11 09:31 derick Assigned To => derick
2011-04-11 09:31 derick Status new => feedback
2011-04-13 00:08 trebly Note Added: 0001723
2011-04-13 00:08 trebly Status feedback => assigned
2014-05-19 23:09 derick Note Added: 0002816
2014-05-19 23:09 derick Status assigned => feedback
2014-06-14 10:33 derick Note Added: 0002849
2014-06-14 10:33 derick Status feedback => resolved
2014-06-14 10:33 derick Resolution open => no change required
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)