Skip to content

Assertion failure triggered in phpdbg with ASAN and ZEND_RC_DEBUG=1 #14596

Closed
@TimWolla

Description

@TimWolla

Description

When I configure PHP using:

./configure --enable-zend-test --enable-option-checking=fatal --enable-phpdbg --enable-fpm --enable-werror --enable-debug --enable-zts 'CFLAGS=-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC -DZEND_RC_DEBUG=1' LDFLAGS=-fsanitize=undefined,address CC=clang-16 CXX=clang++-16

and then attempt to run phpdbg, it crashes with an assertion failure:

phpdbg: Zend/zend_types.h:1343: uint32_t zend_gc_delref(zend_refcounted_h *): Assertion `(zval_gc_flags((p)->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)' failed.

Thread 1 "phpdbg" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff78428e6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff78268b7 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff78267db in __assert_fail_base (fmt=0x7ffff79c5168 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55555bb49400 <str> "(zval_gc_flags((p)->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)", file=file@entry=0x55555ac11e86 "Zend/zend_types.h", line=line@entry=1343, 
    function=function@entry=0x55555bb494c0 <__PRETTY_FUNCTION__.zend_gc_delref> "uint32_t zend_gc_delref(zend_refcounted_h *)") at ./assert/assert.c:92
#6  0x00007ffff7839206 in __assert_fail (assertion=0x55555bb49400 <str> "(zval_gc_flags((p)->u.type_info) & ((1<<7)|(1<<8))) != (1<<7)", file=0x55555ac11e86 "Zend/zend_types.h", line=1343, function=0x55555bb494c0 <__PRETTY_FUNCTION__.zend_gc_delref> "uint32_t zend_gc_delref(zend_refcounted_h *)")
    at ./assert/assert.c:101
#7  0x000055555a89d990 in zend_gc_delref (p=0x604000041d50) at Zend/zend_types.h:1343
#8  0x000055555a89d05a in zend_string_release (s=0x604000041d50) at Zend/zend_string.h:347
#9  0x000055555a8cf291 in zm_activate_phpdbg (type=1, module_number=27) at sapi/phpdbg/phpdbg.c:237
#10 0x00005555598ace4d in zend_activate_modules () at Zend/zend_API.c:3365
#11 0x00005555591f65fb in php_request_startup () at main/main.c:1823
#12 0x000055555a8aa2ba in main (argc=1, argv=0x7fffffffe3a8) at sapi/phpdbg/phpdbg.c:1456

PHP Version

git master

Operating System

Ubuntu 23.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions