View Issue Details

IDProjectCategoryView StatusLast Update
0002081XdebugStacktracespublic2024-01-19 07:20
Reporterf.bosch@genkgo.nl Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityunable to reproduce
Status resolvedResolutionunable to reproduce 
Product Version3.1.4 
Summary0002081: SIGSEGV, Segmentation fault in xdebug_append_printable_stack
Description

/ $ gdb /usr/local/sbin/php-fpm /tmp/core-php-fpm.38
warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing
[New LWP 38]
Core was generated by `php-fpm: pool www '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 xdebug_append_printable_stack (str=str@entry=0x7ffd7897a000, html=<optimized out>) at /tmp/pear/temp/xdebug/src/develop/stack.c:453
453 /tmp/pear/temp/xdebug/src/develop/stack.c: No such file or directory.
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) quit
/ $ exit

TagsNo tags attached.
Operating System
PHP Version8.0.10-8.0.19

Activities

f.bosch@genkgo.nl

2022-04-06 11:50

reporter   ~0006266

The bug does not occur on PHP 7.4. I cannot test on PHP 8.1 yet. Also, it occurs on a request that does not generate an error when xdebug is disabled with xdebug.mode=off. When I use xdebug.mode=develop,profile it generates the error.

derick

2022-04-06 15:07

administrator   ~0006267

How can I reproduce this? Your GDB trace alone is not nearly enough. Please follow the instructions at https://xdebug.org/reporting-bugs

derick

2022-05-25 14:24

administrator   ~0006314

I don't know how to reproduce this, and the requested information was not provided so I am closing this report.

f.bosch@genkgo.nl

2022-05-25 14:31

reporter   ~0006317

Sorry Derick, I forgot to mention that I was unable to create a reproducible example. I felt it was related to some class autolpading when I was creating it through a dependency injection container. But since it was so deep into the object graph, I was not able to locate it exactly. Then I decided to file the bug with a stack trace. Maybe when someone else has a similar issue, this one popups again.

f.bosch@genkgo.nl

2022-05-27 08:57

reporter   ~0006321

Hi Derick,
Today I am hitting this bug again. It is an API POST request that returns a nginx 502.

2022-05-27T08:37:56.254857614Z php-fpm 19 [27-May-2022 08:37:56] NOTICE: fpm is running, pid 19
2022-05-27T08:37:56.266022054Z php-fpm 19 [27-May-2022 08:37:56] NOTICE: ready to handle connections
2022-05-27T08:38:01.12628901Z nginx 20 2022/05/27 08:38:01 [error] 21#21: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.1, server: ~^(?<project>[a-z0-9-]+).(?<project_domain>genkgo.test)$, request: "POST /admin/api/mobile/vweb-app/1/access_token HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-fpm-www-pool.pid:", host: "genkgo-demo.genkgo.test", referrer: "http://localhost:4200/&quot;
2022-05-27T08:38:01.126336282Z php-fpm 19 [27-May-2022 08:38:01] WARNING: [pool www] child 29 exited on signal 11 (SIGSEGV - core dumped) after 4.870485 seconds from start
2022-05-27T08:38:01.126354184Z nginx 20 172.18.0.1 - "POST /admin/api/mobile/vweb-app/1/access_token HTTP/2.0" 502 150 "http://localhost:4200

But debugging this one is extremely hard. The request fails during constructing the dependency graph. I am using aura/di as container.

1) On this line: https://github.com/auraphp/Aura.Di/blob/4.x/src/Resolver/Resolver.php#L247 it is trying to see what to inject in the constructor of a class
2) On this line: https://github.com/auraphp/Aura.Di/blob/4.x/src/Resolver/Resolver.php#L303 it is returning a default value if no value is passed

The crash happens when returning the value on the latter line (not during construction of that DefaultValueParam class). And now comes even more weird part. It can be solved by changing the constructor. The file that is being constructed looks as follows.

public function __construct(
DataTypeFactory $factory = null,
MapperFactoryFactoryInterface $mapperFactoryFactory = null,
array $scopes = []
) {}

If I change the last parameter, the one that is causing the crash during construction, into this.

public function __construct(
DataTypeFactory $factory = null,
MapperFactoryFactoryInterface $mapperFactoryFactory = null,
$scopes = []
) {}

The problem disappears.

f.bosch@genkgo.nl

2022-05-27 09:06

reporter   ~0006322

So removing that array type-hint resolves the issue, and considering that my coredump shows: /tmp/pear/temp/xdebug/src/develop/stack.c No such file or directory. Could it somehow be that the array is seen as something that needs to be loaded from the filesystem?

texnicii

2024-01-19 06:54

reporter   ~0006788

I still have the same problem

// My Xdebug and PHP version
PHP 8.1.26 (cli) (built: Dec 1 2023 00:32:14) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.26, Copyright (c) Zend Technologies
with Zend OPcache v8.1.26, Copyright (c), by Zend Technologies
with Xdebug v3.3.0, Copyright (c) 2002-2023, by Derick Rethans

When Xdebug activated I received this
2024/01/19 06:40:30 [error] 36#36: *38 recv() failed (104: Connection reset by peer) while reading response header from upstream

texnicii

2024-01-19 07:20

reporter   ~0006789

I tried with Xdebug v3.3.1 - the same crash
For Xdebug v3.2.0 - working fine (no crash with web requests and cli)

Issue History

Date Modified Username Field Change
2022-04-06 10:50 f.bosch@genkgo.nl New Issue
2022-04-06 11:50 f.bosch@genkgo.nl Note Added: 0006266
2022-04-06 15:07 derick Assigned To => derick
2022-04-06 15:07 derick Status new => feedback
2022-04-06 15:07 derick Note Added: 0006267
2022-05-25 14:24 derick Status feedback => resolved
2022-05-25 14:24 derick Resolution open => unable to reproduce
2022-05-25 14:24 derick Note Added: 0006314
2022-05-25 14:31 f.bosch@genkgo.nl Note Added: 0006317
2022-05-27 08:57 f.bosch@genkgo.nl Note Added: 0006321
2022-05-27 09:06 f.bosch@genkgo.nl Note Added: 0006322
2024-01-19 06:54 texnicii Note Added: 0006788
2024-01-19 07:20 texnicii Note Added: 0006789