View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002168 | Xdebug | Uncategorized | public | 2023-03-30 05:50 | 2024-04-15 13:28 |
Reporter | john@unifi.credit | Assigned To | derick | ||
Priority | low | Severity | minor | Reproducibility | random |
Status | resolved | Resolution | suspended | ||
Platform | Linux | OS | Ubuntu | OS Version | 22.04 |
Product Version | 3.1.2 | ||||
Summary | 0002168: Flush not guaranteed | ||||
Description | This happened on a PHP project without any framework (such as Laravel) on Apache and PHP 8.1 FPM. I am working on a PHP site that had the odd behaviour of returning empty content to an AJAX request randomly but then I found a specific value (part of JSON POST) that would consistently cause an empty response. Debugging the handler showed no sign of any problem. The JSON response was echoed in the very last line of the code and after that destructors were called. By adding flush() at the end of the script, the problem was solved. At first I suspected a destructor caused an exception which might then cause a flush not to be done. I switched on tracing and found the names of destructors and commented them out (commented flush out as well). This did not fix the problem and then I disabled XDebug after which the PHP response was returned as expected without fail. The moment I enabled XDebug again, the problem persisted again. This problem is not consistent. The value I mentioned earlier was a numeric value (ID number) and the only time I was able to consistently cause the problem was for a specific ID that happened to start with 2 zeros. On other values the problem happened sporadically and sometimes not at all. My best guess is that there is a specific state in XDebug which prevents a flush once the request is complete. Best guess would be that an exception is thrown in XDebug module which prevents PHP from calling the flush. | ||||
Steps To Reproduce | This issue is so sporadic that I believe there is very little chance anyone else can reproduce it consistently. Since I seem to have a silver bullet, I can help by generating an XDebug module log if someone can guide me on how to do this. | ||||
Tags | debug | ||||
Operating System | Ubuntu 22.04 | ||||
PHP Version | 8.1.0-8.1.4 | ||||
|
Hi, I am not sure if we'll ever find this out... but Xdebug should not mess with flushing at all. If this is still a problem for you, an Xdebug log file while debugging ( cheers, |
|
I am closing this, as there is no actionable task for me here, unless there is a reproducer. Which as you said, would be really hard to find. I also believe, as I've already said, that Xdebug ought not to change anything with output buffers. |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-03-30 05:50 | john@unifi.credit | New Issue | |
2023-03-30 05:50 | john@unifi.credit | Tag Attached: debug | |
2023-08-01 10:13 | derick | Assigned To | => derick |
2023-08-01 10:13 | derick | Status | new => feedback |
2023-08-01 10:13 | derick | Note Added: 0006623 | |
2024-04-15 13:28 | derick | Status | feedback => resolved |
2024-04-15 13:28 | derick | Resolution | open => suspended |
2024-04-15 13:28 | derick | Note Added: 0006904 |