View Issue Details

IDProjectCategoryView StatusLast Update
0002236XdebugStep Debuggingpublic2024-01-15 15:25
Reporterblackthornedk Assigned Toderick  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionduplicate 
Platformx86_64OSAlmaLinux 8.9 (Midnight Oncilla)OS Version8.9
Product Version3.3.1 
Summary0002236: SIGSEGV in zend_string_equal_content
Description

We have some endpoints in our Symfony Application, which produces a crash in XDebug.
It only occurs, if the IDE is listening to incoming connections, and a breakpoint is enabled.
It can occur, even if the breakpoint is not anywhere near the code being tested.

I did a core dump, and looked through the backtrace.
It looks like the zend_string_equals get a bogus argument, which was returned by zend_get_executed_filename_ex in debugger/debugger.c:554
I have not been able to dig through php-src/Zend/zend_execute_API.c to figure out, why zend_get_executed_filename_ex returns 0x2.

I have working endpoints, where I can reproduce the error, but since the code is proprietary, I cannot share it.
I did not manage to isolate the issue, as changing the code seem to make the problem go away.

Additional Information
Program terminated with signal SIGSEGV, Segmentation fault.
#0  zend_string_equal_content (s2=0x2, s1=0x7f86a9e76070) at /usr/include/php/Zend/zend_string.h:357
357     /usr/include/php/Zend/zend_string.h: No such file or directory.
(gdb) bt
#0  zend_string_equal_content (s2=0x2, s1=0x7f86a9e76070) at /usr/include/php/Zend/zend_string.h:357
#1  zend_string_equals (s2=0x2, s1=0x7f86a9e76070) at /usr/include/php/Zend/zend_string.h:362
0000002  mark_fse_as_having_line_breakpoints (fse=0x55d84894efa0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/debugger/debugger.c:573
0000003  handle_breakpoints (return_value=0x7f86a9e131b0, breakpoint_type=8, fse=0x55d84894efa0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/debugger/debugger.c:591
0000004  xdebug_debugger_handle_breakpoints (fse=fse@entry=0x55d84894efa0, breakpoint_type=breakpoint_type@entry=8, return_value=return_value@entry=0x7f86a9e131b0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/debugger/debugger.c:623
0000005  0x00007f869c900610 in xdebug_execute_internal_end (current_execute_data=0x7f86a9e131d0, return_value=0x7f86a9e131b0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/base/base.c:998
0000006  xdebug_execute_internal (current_execute_data=0x7f86a9e131d0, return_value=0x7f86a9e131b0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/base/base.c:1022
0000007  0x000055d845fa3c50 in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1981
0000008  0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000009  0x000055d845fa3bbb in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1946
0000010 0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000011 0x000055d845fa3bbb in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1946
0000012 0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000013 0x000055d845fa3bbb in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1946
0000014 0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000015 0x000055d845fa3bbb in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1946
0000016 0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000017 0x000055d845fa3bbb in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:1946
0000018 0x000055d8461d2a6f in execute_ex (ex=0x7f86a9e76070) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:55852
0000019 0x000055d8461d2ccc in zend_execute (op_array=0x7f86a9e74000, return_value=0x0) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend_vm_execute.h:60188
0000020 0x000055d846162235 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/Zend/zend.c:1857
0000021 0x000055d8460fd2aa in php_execute_script (primary_file=<optimized out>) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/main/main.c:2551
0000022 0x000055d845faf231 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-8.1.27-1.el8.remi.x86_64/sapi/fpm/fpm/fpm_main.c:1935
(gdb) frame 2
0000002  mark_fse_as_having_line_breakpoints (fse=0x55d84894efa0) at /usr/src/debug/php-pecl-xdebug3-3.3.1-1.el8.remi.8.1.x86_64/src/src/debugger/debugger.c:573
573                     } else if (!zend_string_equals(extra_brk_info->filename, executed_filename)) {
(gdb) info locals
extra_brk_info = 0x55d8485e8b10
executed_filename = 0x2
le = 0x55d848782f40
le = <optimized out>
extra_brk_info = <optimized out>
executed_filename = <optimized out>
resolved_filename = <optimized out>
(gdb) ptype executed_filename
type = struct _zend_string {
    zend_refcounted_h gc;
    zend_ulong h;
    size_t len;
    char val[1];
} *
(gdb) print executed_filename
$1 = (zend_string *) 0x2
[root@opsdev4.zitcom.dk ~]# dnf list installed | grep xdebug
php-pecl-xdebug3.x86_64                            3.3.1-1.el8.remi.8.1                                       @remi-modular
php-pecl-xdebug3-debuginfo.x86_64                  3.3.1-1.el8.remi.8.1                                       @remi-modular-debuginfo
php-pecl-xdebug3-debugsource.x86_64                3.3.1-1.el8.remi.8.1                                       @remi-modular-debuginfo
[root@opsdev4.zitcom.dk ~]# dnf list installed | grep php-fpm
php-fpm.x86_64                                     8.1.27-1.el8.remi                                          @remi-modular
php-fpm-debuginfo.x86_64                           8.1.27-1.el8.remi                                          @System
[root@opsdev4.zitcom.dk ~]# dnf list installed | grep php-common
php-common.x86_64                                  8.1.27-1.el8.remi                                          @remi-modular
php-common-debuginfo.x86_64                        8.1.27-1.el8.remi                                          @remi-modular-debuginfo
TagsNo tags attached.
Operating SystemAlmaLinux 8.9 (Midnight Oncilla)
PHP Version8.1.10-8.1.19

Relationships

duplicate of 0002229 assignedderick Sigsegv when breakpoint is set 

Activities

derick

2024-01-15 15:24

administrator   ~0006776

This looks the same as in 0002229 - in both cases, zend_get_executed_filename returns rubbish.

Issue History

Date Modified Username Field Change
2024-01-12 14:03 blackthornedk New Issue
2024-01-15 15:24 derick Assigned To => derick
2024-01-15 15:24 derick Status new => resolved
2024-01-15 15:24 derick Resolution open => duplicate
2024-01-15 15:24 derick Note Added: 0006776
2024-01-15 15:24 derick Relationship added duplicate of 0002229
2024-01-15 15:25 derick Additional Information Updated