View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002349 | Xdebug | Step Debugging | public | 2025-05-19 20:01 | 2025-06-05 16:51 |
Reporter | lcarilla | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | feedback | Resolution | open | ||
Summary | 0002349: https://github.com/xdebug/xdebug/commit/3bb2937e94dfcea6359e9f745e534e2049b2d45d breaks throwing exceptions in nested generators | ||||
Description | For the code in the "Steps To Reproduce" section, php with xdebug segfaults. | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Operating System | Linux | ||||
PHP Version | 8.4-dev | ||||
|
How do you run this to make it segfault? When running this on the command line in the following ways, I can't reproduce this:
And valgrind shows no warnings either. |
|
I'm pretty sure I've got the same error as lcarilla. I haven't been able to reduce it to an actually small example, but when there is an exception reading messages from RabbitMQ with Xdebug active, it gives a segfault (Symfony uses generators for this, that's why I believe we are talking about the same error). I have prepared a minimal Symfony project to reproduce the issue: https://github.com/juanmcasanova/xdebug-2349 If you need anything else from me (or that I create a new issue), just let me know! |
|
Sorry, forgot to include my PHP version information: PHP 8.3.21 (cli) (built: May 21 2025 23:17:35) (NTS) |
|
@Juancasanova: How do I run that Symfony project to reproduce? I know nothing about Symfony, and running the commands in the README still gives me errors: |
|
I was able to create a reproducer for this - and probably also https://bugs.xdebug.org/view.php?id=2350 and https://bugs.xdebug.org/view.php?id=2352 Since it was so hard to pin done the exact crashing conditions I put the code inside a reproducer repo that can simply be opened in vscode devcontainers / codespaces: https://github.com/acran/xdebug-2349-reproducer The code example is use Twig\Environment; require_once DIR . '/vendor/autoload.php'; $loader = new ArrayLoader([ class User { $user = new User(); try {
} catch (Throwable $e) { </code> The crash only occurs when an Exception is thrown within Twig\Template::doDisplay() (https://github.com/twigphp/Twig/blob/285123877d4dd97dd7c11842ac5fb7e86e60d81d/src/Template.php#L526-L534) (which is implemented by a dynamically generated class for the rendered template). Both methods are generators which puts the Exception in the context of nested generators. More things I noticed:
|
|
Thanks, I'll see if this is enough info to reproduce this in the next few days, and then also hopefully fix it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-05-19 20:01 | lcarilla | New Issue | |
2025-05-20 18:10 | derick | Steps to Reproduce Updated | |
2025-05-20 18:18 | derick | Assigned To | => derick |
2025-05-20 18:18 | derick | Status | new => feedback |
2025-05-20 18:18 | derick | Note Added: 0007288 | |
2025-05-23 08:35 | juancasanova | Note Added: 0007293 | |
2025-05-23 08:40 | juancasanova | Note Added: 0007294 | |
2025-06-02 14:51 | derick | Note Added: 0007297 | |
2025-06-05 10:45 | acran | Note Added: 0007300 | |
2025-06-05 10:45 | acran | File Added: xdebug-2349-reproducer-master.zip | |
2025-06-05 16:51 | derick | Note Added: 0007303 |