View Issue Details

IDProjectCategoryView StatusLast Update
0002242XdebugUncategorizedpublic2024-07-18 13:33
Reporterjozef.kovac Assigned Toderick  
PriorityhighSeveritycrashReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version3.3.1 
Summary0002242: process always segfault for some requests
Description

PHP8.2 with xdebug extension 3.3.0/3.3.1 always crashing for some requests/years, downgrading back to 3.2.2 is fixing the problem. Same for PHP 8.3 with xdebug 3.3.1.

There is no acitve debuging ongoing just extension is loaded. We use xdebug only on development instances.

php-fpm

php_admin_value[xdebug.mode] = develop,profile
php_admin_value[xdebug.output_dir] = /data/profiler
php_admin_value[xdebug.start_with_request] = trigger
php_admin_value[xdebug.trigger_value] = <removed but limited to IP & cookie anyway>
php_admin_value[xdebug.profiler_output_name] = "callgrind.out.%H.%R.%p.grind"
php_admin_value[xdebug.var_display_max_depth] = -1
php_admin_value[xdebug.var_display_max_children] = -1
php_admin_value[xdebug.var_display_max_data] = -1

php.ini

zend_extension=xdebug.so
xdebug.mode=develop,profile,debug

#core dump
Core was generated by `php-fpm: pool dev '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 zend_mm_alloc_small (bin_num=3, heap=0x7f8fd8c00040)
at /usr/src/debug/php83-php-8.3.2-1.el9.x86_64/Zend/zend_alloc.c:1312
1312 heap->free_slot[bin_num] = p->next_free_slot;

dmesg

php-fpm[3595236]: segfault at 9bae0243 ip 000055d8b642a19a sp 00007ffd8d7c0010 error 4 in php-fpm[55d8b6200000+318000]
Code: 69 c0 41 04 00 00 48 01 d0 48 89 fa 48 c1 e2 05 4c 01 c0 48 01 fa 48 01 d0 49 89 c6 4c 8b 69 10 0b 41 0c 48 98 49 0f ba ee 3f <45> 8b 64 85 00 41 83 fc ff 75 16 eb 79 66 0f 1f 84 00 00 00 00 00
traps: php-fpm[3831811] general protection fault ip:55b9d7be60c7 sp:7ffc34dd0388 error:0 in php-fpm[55b9d7a00000+318000]

Xdebug is reporiting loading before Opcache, but opcache is disabled for development instances.

Steps To Reproduce

I choose "always reproducible" but only tested on our setup.

TagsNo tags attached.
Operating SystemRHEL 9.3 x86_64
PHP Version8.2.0-8.2.9

Relationships

has duplicate 0002235 resolvedderick Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) 

Activities

derick

2024-01-30 11:58

administrator   ~0006822

Could you add the output of bt full from the GDB prompt after you've opened the core dump please?

jozef.kovac

2024-01-30 19:13

reporter   ~0006828

Here it is

bt_full.txt (23,783 bytes)   

eiwaen

2024-03-28 16:14

reporter   ~0006867

It seems we are affected by the same problem, as we're getting seemingly random segmentation faults since upgrading to Xdebug 3.3.1 (from Xdebug 3.2.x) on PHP 8.2.
Just as for the reporter, it also happens when there is no debug session ongoing.

Would it help to provide more data? If so, please provide information what is required (I'm not familiar with inspecting segmentation faults).

derick

2024-03-29 14:34

administrator   ~0006881

Can any of you reproduce this on the command line, with the run of a single request?

Preferably, you run it like:

USE_ZEND_ALLOC=0 gdb --args php script.php

(and then "run")

If that crashes, I am also interested in seeing the same, but run like:

USE_ZEND_ALLOC=0 valgrind php script.php

As so far, I can't reproduce this yet — although it does happen when an exception is thrown:

        tmp_str = {l = 4860617, a = 4862335, d = 0x55cb13ccf0e0 "\n\033[1m\033[31mDoctrine\\ORM\\Mapping\\MappingException\033[0m: Class \"Macroactive\\Core\\Common\\Domain\\Model\\Email\" is not a valid entity or mapped super class.\033[22m in \033[31m/www/platform/vendor/doctrine/orm/lib/"...} 

Perhaps this happens during auto loading?

SCIF

2024-03-30 00:11

reporter   ~0006885

Hi @derick,

Perhaps this happens during auto loading?

Nope, the crash happens during the tests execution so most likely this is some issue during the import? Weird though.

SCIF

2024-03-30 00:38

reporter   ~0006886

Hi @dercik,

The first command has crashed so please find attached the log of the running valgrind. Is this expected that tests passed and not crashed in this case??

valgrind.log.gz (13,307 bytes)

eiwaen

2024-04-02 09:35

reporter   ~0006888

In our case, I believe we haven't experienced a segmentation fault for command line scripts.
Only HTTP requests seem affected.

We're using the official 8.2-apache Docker image.

wahalahti

2024-04-09 21:02

reporter   ~0006892

We are facing similar problems with PHP 8.0.30 and xdebug 3.3.1 in develop mode for HTTP requests. Couldn't reproduce in command line when quickly tested.

PHP error log indicated "exited on signal 11" without any lines written to xdebug log.

derick

2024-04-15 13:54

administrator   ~0006913

I have released Xdebug 3.3.1, which could have fixed this issue. Can you please try it?

SCIF

2024-04-16 01:02

reporter   ~0006918

Hi @derick, thanks for the update!

I think you meant 3.3.2, not 3.3.1. I have updated my docker image and still can see segfault on the same test suite. Do you need valgrind or gdb logs?

SCIF

2024-04-16 01:36

reporter   ~0006919

GDB shows a warning:

warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]

Not sure if it was present before.

Nothing has changed in the logs of the valgrind.
Attaching new logs.

valgrind.log-2.gz (10,596 bytes)
gdb-log.txt.gz (2,854 bytes)

eiwaen

2024-04-17 08:29

reporter   ~0006925

Thanks, @derick, for releasing 3.3.2!

For us, the problem seems to be gone, i.e. there were no more segmentation faults since we updated to the new version.

arku31

2024-04-25 11:35

reporter   ~0006930

Hi,
I am seeing something similar. Unfortunately, I am not able to provide that much helpful information but some key facts:

php --version

PHP 8.1.28 (cli) (built: Apr 24 2024 19:21:45) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.28, Copyright (c) Zend Technologies
with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

We were running tests with PHPUnit 9.6.9 and they were also failing with status code 139. Rolling back to 3.2.2 helped.

Hope someone, who is more familiar will be able to share more insides, just wanted to share that the issue is still somewhere around

jozef.kovac

2024-05-28 09:06

reporter   ~0006961

Looks like we found similar with Xdebug 3.3.2 and PHP 8.3.7. Again there is no debug session or profiling, Xdebug extension is just loaded.

gdb.txt (25,201 bytes)   

derick

2024-07-18 13:33

administrator   ~0007010

The original reporter still has not yet a provided a way on how to reproduce this problem.

There are currently several reported crash bugs where more than one person added information, but often with a different cause. This makes researching this challenging, especially because I still do not have a reproducible case.

I am going to close this ticket (and the others), and will only accept issues related to crashes when there is a full reproducible case — the exact steps on how I could potentially try to have the same issue.

Issue History

Date Modified Username Field Change
2024-01-30 10:10 jozef.kovac New Issue
2024-01-30 11:58 derick Assigned To => derick
2024-01-30 11:58 derick Status new => feedback
2024-01-30 11:58 derick Note Added: 0006822
2024-01-30 19:13 jozef.kovac Note Added: 0006828
2024-01-30 19:13 jozef.kovac File Added: bt_full.txt
2024-01-30 19:13 jozef.kovac Status feedback => assigned
2024-02-08 14:32 derick Relationship added has duplicate 0002235
2024-03-28 16:14 eiwaen Note Added: 0006867
2024-03-29 14:34 derick Status assigned => feedback
2024-03-29 14:34 derick Note Added: 0006881
2024-03-30 00:11 SCIF Note Added: 0006885
2024-03-30 00:38 SCIF Note Added: 0006886
2024-03-30 00:38 SCIF File Added: valgrind.log.gz
2024-04-02 09:35 eiwaen Note Added: 0006888
2024-04-09 21:02 wahalahti Note Added: 0006892
2024-04-15 13:54 derick Note Added: 0006913
2024-04-16 01:02 SCIF Note Added: 0006918
2024-04-16 01:36 SCIF Note Added: 0006919
2024-04-16 01:36 SCIF File Added: valgrind.log-2.gz
2024-04-16 01:36 SCIF File Added: gdb-log.txt.gz
2024-04-17 08:29 eiwaen Note Added: 0006925
2024-04-25 11:35 arku31 Note Added: 0006930
2024-05-28 09:06 jozef.kovac Note Added: 0006961
2024-05-28 09:06 jozef.kovac File Added: gdb.txt
2024-05-28 09:06 jozef.kovac Status feedback => assigned
2024-07-18 13:33 derick Status assigned => resolved
2024-07-18 13:33 derick Resolution open => unable to reproduce
2024-07-18 13:33 derick Note Added: 0007010