View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002335 | Xdebug | Step Debugging | public | 2025-04-11 19:31 | 2025-04-14 23:33 |
Reporter | Zobo | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 3.4.2 | ||||
Target Version | 3.4dev | ||||
Summary | 0002335: Failed dbgp connection is not marked as not active | ||||
Description | If a DBGP client disconnects from Xdebug - without sending the The problem is that the return of xdebug_dbgp_cmdloop() is never checked. Return value of 0 indicates that the connection is dropped. Proposed fix is to update the connection state with xdebug_mark_debug_connection_not_active() inside xdebug_dbgp_cmdloop() | ||||
Steps To Reproduce | XDEBUG_MODE=debug while (true) { Start dbgpClient, when Xdebug connects, Ctrl-C out. Start dbgpClient again, Xdebug will not connect to it again. | ||||
Additional Information | The fix caused an interesting problem with tests. Attaching the comment from the PR here. https://github.com/xdebug/xdebug/pull/1002#issuecomment-2752219515 So I just want to write this down as it took me way to long to understand what's going on and why it can't be fixed elegantly. Had to refresh my knowledge about POSIX sockets. Word of the day: Socket inheritance with child process fork/clone. So what's happening is that the change (probably correctly) causes Xdebug to reconnect to the dbcp client for every xdebug_break() call. Now the test is written so, that it expect the code to break one time, does some dbgp commands and disconnects and lets PHP run. But hey, you say, when we send all command we actually stop listening to dbgp port! So the way I see it, there's two options for fixes: modify dbgpClient.php to keep accepting and dropping DBGP connections until the child process exits... | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 8.2.0-8.2.9 | ||||