View Issue Details

IDProjectCategoryView StatusLast Update
0002048XdebugUncategorizedpublic2023-12-12 09:27
Reporterremi Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product Version3.1.2 
Summary0002048: Segfault during test suite (i686)
Description

Encounter during Fedora 36 build with PHP 8.1.0

Steps To Reproduce

Run test suite

========DIFF========
003+ Termsig=11
003- Fatal error: Uncaught FiberError: Cannot switch fibers in current execution context in %sbug02036.php on line 11
004-
005- FiberError: Cannot switch fibers in current execution context in %sbug02036.php on line 11
006-
007- Call Stack:
008- %w%f %w%d 1. {fiber:%s}() %sbug02036.php:15
009- %w%f %w%d 2. {closure:%sbug02036.php:7-13}() %sbug02036.php:15
010- %w%f %w%d 3. Fiber->start() %sbug02036.php:11
========DONE========
FAIL Test for bug 0002036: Segfault on fiber switch in finally block in garbage collected fiber (>= PHP 8.1) [tests/base/bug02036.phpt]

Additional Information

GDB backtrace

(gdb)
#0 0x5678182b in format_converter ()
#1 0x56782ac5 in ap_php_vsnprintf ()
0000002 0xf74e82ea in xdebug_str_add_va_fmt (xs=0x56ef1b10, fmt=0xf750c310 "{fiber:%0X}", argv=0xf71ffee0 "\254a(\367\215\030N\367\200\362\337V\230\377\037\367\236\253\243w\020\033\357V")
at /builddir/build/BUILD/php-pecl-xdebug3-3.1.2/NTS/src/lib/str.c:114
0000003 0xf74e8408 in xdebug_str_add_fmt (xs=0x56ef1b10, fmt=0xf750c310 "{fiber:%0X}") at /builddir/build/BUILD/php-pecl-xdebug3-3.1.2/NTS/src/lib/str.c:141
0000004 0xf74e18a4 in create_key_for_fiber (fiber=0xf72861ac) at /builddir/build/BUILD/php-pecl-xdebug3-3.1.2/NTS/src/base/base.c:1036
0000005 remove_stack_for_fiber (fiber=0xf72861ac) at /builddir/build/BUILD/php-pecl-xdebug3-3.1.2/NTS/src/base/base.c:1079
0000006 xdebug_fiber_switch_observer (from=0xf72861ac, to=0xf7256000) at /builddir/build/BUILD/php-pecl-xdebug3-3.1.2/NTS/src/base/base.c:1103
0000007 0x5687d2b8 in zend_observer_fiber_switch_notify ()
0000008 0x5687f31d in zend_fiber_switch_context ()
0000009 0x5687fb1f in zend_fiber_trampoline ()
0000010 0x5677db6f in make_fcontext ()
0000011 0xffff97b4 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

TagsNo tags attached.
Operating System
PHP Version8.1.0-8.1.4

Activities

remi

2021-12-02 08:04

reporter   ~0006168

No issue on Fedora 35 with PHP 8.0
No issue on Fedora 34 with PHP 7.4

remi

2021-12-02 12:47

reporter   ~0006169

Same segfault with 8.1.1RC1

https://kojipkgs.fedoraproject.org//work/tasks/8422/79508422/build.log

derick

2022-01-26 20:13

administrator   ~0006197

Is this still an issue that we need to care about?

remi

2022-01-27 06:26

reporter   ~0006198

The segfault still exists on i686 (using php 8.1.2RC1 and GCC 12)

remi

2022-01-27 06:49

reporter   ~0006199

The segfault still exists on i686 using xdebug_3_1 git snapshot

remi

2022-03-23 14:28

reporter   ~0006249

Notice: ppc64le is also affected.

derick

2022-03-25 16:22

administrator   ~0006255

I still don't have a way on how to reproduce this easily. And until I can do that, I can't fix this.

derick

2023-08-01 10:36

administrator   ~0006626

I still can't reproduce this, and I haven't heard any other bug reports because of this either. I am therefore closing this issue.

remi

2023-12-12 09:24

reporter   ~0006722

Last edited: 2023-12-12 09:27

Reproduced un emulated ppc64le running Fedora 39

(gdb) run  -n   -d "output_handler=" -d "open_basedir=" -d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" -d "html_errors=0" -d "track_errors=0" -d "report_memleaks=1" -d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" -d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" -d "auto_append_file=" -d "ignore_repeated_errors=0" -d "precision=14" -d "serialize_precision=-1" -d "memory_limit=128M" -d "opcache.fast_shutdown=0" -d "opcache.file_update_protection=0" -d "opcache.revalidate_freq=0" -d "opcache.jit_hot_loop=1" -d "opcache.jit_hot_func=1" -d "opcache.jit_hot_return=1" -d "opcache.jit_hot_side_exit=1" -d "zend.assertions=1" -d "zend.exception_ignore_args=0" -d "zend.exception_string_param_max_len=15" -d "short_open_tag=0" -d "extension=simplexml" -d "zend_extension=/home/remi/xdebug/modules/xdebug.so" -d "session.auto_start=0" -d "zlib.output_compression=Off" -d "xdebug.mode=develop" -f "/home/remi/xdebug/tests/base/bug02036.php"

Program received signal SIGSEGV, Segmentation fault.
0x0000000100442160 in zim_Exception___toString (execute_data=0x7ffff6e89070, return_value=0x7fffffffae58) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_exceptions.c:724
724         Z_PROTECT_RECURSION_P(exception);
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.38-14.fc39.ppc64le libedit-3.1-48.20230828cvs.fc39.ppc64le libxcrypt-4.4.36-2.fc39.ppc64le libxml2-2.10.4-3.fc39.ppc64le ncurses-libs-6.4-7.20230520.fc39.ppc64le openssl-libs-3.1.1-4.fc39.ppc64le pcre2-10.42-1.fc39.2.ppc64le xz-libs-5.4.4-1.fc39.ppc64le zlib-1.2.13-4.fc39.ppc64le
(gdb) bt
#0  0x0000000100442160 in zim_Exception___toString (execute_data=0x7ffff6e89070, return_value=0x7fffffffae58) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_exceptions.c:724
#1  0x0000000100367544 in zend_call_function (fci=0x7fffffffad88, fci_cache=0x7fffffffad68) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_execute_API.c:962
0000002  0x0000000100367f40 in zend_call_known_function (fn=0x100712010, object=<optimized out>, called_scope=<optimized out>, retval_ptr=<optimized out>, param_count=<optimized out>, params=<optimized out>, 
    named_params=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_execute_API.c:1043
0000003  0x0000000100110f10 in zend_call_known_instance_method (params=0x0, param_count=0, retval_ptr=0x7fffffffae58, object=0x7ffff6e5f280, fn=<error reading variable: value has been optimized out>)
    at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_API.h:753
0000004  zend_call_known_instance_method_with_0_params (retval_ptr=0x7fffffffae58, object=0x7ffff6e5f280, fn=<error reading variable: value has been optimized out>)
    at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_API.h:759
0000005  zend_exception_error (ex=0x7ffff6e5f280, severity=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_exceptions.c:920
0000006  0x0000000100475bbc in zend_fiber_object_destroy (object=0x7ffff6e6b640) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_fibers.c:644
0000007  zend_fiber_object_destroy (object=0x7ffff6e6b640) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_fibers.c:613
0000008  0x00000001004664a0 in zend_objects_store_del (object=0x7ffff6e6b640) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_objects_API.c:184
0000009  0x000000010037b4e4 in rc_dtor_func (p=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_variables.c:57
0000010 0x000000010037b66c in i_zval_ptr_dtor (zval_ptr=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_variables.h:44
0000011 zval_ptr_dtor (zval_ptr=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_variables.c:84
0000012 0x000000010039c878 in _zend_hash_del_el_ex (prev=<optimized out>, p=<optimized out>, idx=<optimized out>, ht=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_hash.c:1425
0000013 _zend_hash_del_el (p=0x7ffff6e5a340, idx=<optimized out>, ht=0x100677a10 <executor_globals+304>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_hash.c:1452
0000014 zend_hash_reverse_apply (ht=0x100677a10 <executor_globals+304>, apply_func=0x100364620 <zval_call_destructor>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_hash.c:2168
0000015 0x0000000100364a10 in shutdown_destructors () at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend_execute_API.c:259
0000016 0x000000010037eb34 in zend_call_destructors () at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/Zend/zend.c:1249
0000017 0x00000001002ef0a4 in php_request_shutdown (dummy=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/main/main.c:1825
0000018 0x00000001004d1af8 in do_cli (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/sapi/cli/php_cli.c:1135
0000019 0x000000010011b1dc in main (argc=80, argv=0x100681230) at /usr/src/debug/php-8.2.13-1.fc39.ppc64le/sapi/cli/php_cli.c:1333

Issue History

Date Modified Username Field Change
2021-12-02 08:01 remi New Issue
2021-12-02 08:04 remi Note Added: 0006168
2021-12-02 12:47 remi Note Added: 0006169
2022-01-26 20:13 derick Assigned To => derick
2022-01-26 20:13 derick Status new => feedback
2022-01-26 20:13 derick Note Added: 0006197
2022-01-27 06:26 remi Note Added: 0006198
2022-01-27 06:26 remi Status feedback => assigned
2022-01-27 06:49 remi Note Added: 0006199
2022-03-23 14:28 remi Note Added: 0006249
2022-03-25 16:22 derick Note Added: 0006255
2023-08-01 10:36 derick Status assigned => resolved
2023-08-01 10:36 derick Resolution open => unable to reproduce
2023-08-01 10:36 derick Note Added: 0006626
2023-12-12 09:24 remi Note Added: 0006722
2023-12-12 09:27 derick Note Edited: 0006722