View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001445 | Xdebug | Uncategorized | public | 2017-05-30 16:44 | 2017-05-30 20:31 |
Reporter | bgamrat | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 2.5.1 | ||||
Summary | 0001445: Profiler not capturing POST requests immediately followed by a location.href | ||||
Description | I need to use the profiler (obviously). The application I am working with uses the string returned from an Ajax POST request to redirect to the next action. I need the profile data from the POST request, but it is not creating a profile file for requests that run this way. I am able to get profile data for POST requests which are consumed and not immediately followed by a client side redirect. | ||||
Steps To Reproduce | Test instructions:
form.php
post.php
| ||||
Additional Information | /etc/php5/apache2/conf.d/20-xdebug.ini
| ||||
Tags | No tags attached. | ||||
Operating System | Ubuntu 14.04.5 LTS | ||||
PHP Version | 5.5.20-5.5.24 | ||||
|
How do you activate the debugger? Do you use a "browser plugin" , through requesting the URl with the ?XDEBUG_SESSION_START=foo GET/POST parameter, or through an IDE? Can you check the headers that are being sent by your browser for both the GET request of the form, as well as for the POST through XMLHTTPRequest? |
|
I thought xdebug.profiler_enable=1 ensured all requests would be profiled. |
|
Hmm, it should indeed. I was thinking debugger here. Are you sure they don't end up in another file, or are written to the same file as the first profiling file? There is no reason why these shouldn't work. You can try customising the format of the filename through one of the letters at https://xdebug.org/docs/all#trace_output_name For example, setting xdebug.profiler_output_name to cachegrind.out.%s should do the trick. |
|
It is creating cache grind files okay ...
|
|
This is not a bug. If you would have tried my suggestion to use xdebug.profiler_output_name as cachegrind.out.%s, you would have seen that Xdebug creates the profile file just fine. The issue here is that if you write a profile file (the post.php) one, and then you redirect to form.php again, the same PID is likely going to be used by the webserver for that second request due to Keep Alive features. The number in the cachegrind.out.XXX output is this PID. Because the direct happens after the original request has ended, the profile file just gets overwritten by the location.href request to the old form.php script again. You can also observe this happening by changing your timeout to for example 60 seconds and examine the cachegrind.out.XXX files in the meanwhile. In any case, this is not a bug, so I'm closing this issue. |
|
Thank you - changing the name as you recommended worked. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-05-30 16:44 | bgamrat | New Issue | |
2017-05-30 16:53 | derick | Note Added: 0004353 | |
2017-05-30 16:53 | derick | Assigned To | => derick |
2017-05-30 16:53 | derick | Status | new => feedback |
2017-05-30 16:58 | bgamrat | Note Added: 0004354 | |
2017-05-30 16:58 | bgamrat | Status | feedback => assigned |
2017-05-30 17:08 | derick | Note Added: 0004355 | |
2017-05-30 17:08 | derick | Status | assigned => feedback |
2017-05-30 17:26 | bgamrat | Note Added: 0004356 | |
2017-05-30 17:26 | bgamrat | Status | feedback => assigned |
2017-05-30 17:27 | bgamrat | Note Edited: 0004356 | |
2017-05-30 20:24 | derick | Note Added: 0004357 | |
2017-05-30 20:24 | derick | Status | assigned => resolved |
2017-05-30 20:24 | derick | Resolution | open => no change required |
2017-05-30 20:26 | bgamrat | Note Added: 0004358 | |
2017-05-30 20:31 | bgamrat | Note Edited: 0004358 | |
2020-03-12 16:35 | derick | Category | Usage problems (Wrong Results) => Variable Display |
2020-03-12 16:38 | derick | Category | Variable Display => Uncategorized |