Bug #80371 [Opn]: Sigfault on function call

From: Date: Sun, 15 Nov 2020 16:46:26 +0000
Subject: Bug #80371 [Opn]: Sigfault on function call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230370@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80371&edit=1 ID: 80371 Updated by: nikic@php.net Reported by: paternostersergio6 at gmail dot com Summary: Sigfault on function call Status: Open Type: Bug Package: Scripting Engine problem Operating System: Ubuntu 16.04 Server PHP Version: 8.0.0RC4 Block user comment: N Private report: N New Comment: Would it be possible to run your code under "USE_ZEND_ALLOC=0 valgrind php" and post the resulting log (on gist.github.com for example, it will likely be large)? Previous Comments: ------------------------------------------------------------------------ [2020-11-15 16:35:53] paternostersergio6 at gmail dot com Description: ------------ I do apologize but this bug is too hard to reproduce outside of a complex framework I'm using. I hope the *backtrace* below could help. The segmentation fault happens when I call a static method in a class that just returns true. My (minimal) configuration. No particular changes in php.ini. sudo ./configure --prefix=/usr/local/php/8.0.0RC4 \ --with-pdo-mysql=mysqlnd \ --enable-debug Test script: --------------- /* Note this script works well! It is just to give you an idea of what happens in my framework */ class Process{ public static function isSpecial(string $customernumber) :bool{ // does some checks return true; } public static function addChannel( array $a) :array{ // THIS GENERATES THE SIGFAULT if( self::isSpecial($a['Customer Number']) ) $a['Channel'] = 'AB2'; else $a['Channel'] = 'AB1'; return $a; } } $a = []; $a['Customer Number'] = 'A100200'; $a = Process::addChannel($a); Actual result: -------------- GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 This GDB was configured as "x86_64-linux-gnu". Reading symbols from /usr/local/php/8.0.0RC4/bin/php...done. [New LWP 34435] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/local/php/8.0.0RC4/bin/php -q /home/edsradmin/apps.tmo/scripts/apps.tmo.ph'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000048a8bbbd in ?? () (gdb) bt #0 0x0000000048a8bbbd in ?? () #1 0x00007ffe5551c4c0 in ?? () #2 0x0000000048a4a4b7 in ?? () #3 0x00007f989bc001e0 in ?? () #4 0x00007f989bc14020 in ?? () #5 0x00000000027d9870 in ?? () #6 0x0000000000000006 in ?? () #7 0x00007ffe5551c390 in ?? () #8 0x000000000084d8b9 in zend_mm_alloc_small_slow (heap=0x7f989bc146f0, bin_num=0, __zend_filename=0xe1e00000000 <error: Cannot access memory at address 0xe1e00000000>, __zend_lineno=19025464, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/edsradmin/software/php-8.0.0RC4/Zend/zend_alloc.c:1194 #9 0x00000000009348a7 in zend_execute (op_array=0x7f989bc5e500, return_value=0x0) at /home/edsradmin/software/php-8.0.0RC4/Zend/zend_vm_execute.h:58789 #10 0x000000000088adbf in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/edsradmin/software/php-8.0.0RC4/Zend/zend.c:1680 #11 0x00000000007f00dc in php_execute_script (primary_file=0x7ffe5551ea80) at /home/edsradmin/software/php-8.0.0RC4/main/main.c:2490 #12 0x0000000000972b4e in do_cli (argc=6, argv=0x27c6780) at /home/edsradmin/software/php-8.0.0RC4/sapi/cli/php_cli.c:949 #13 0x0000000000973b2b in main (argc=6, argv=0x27c6780) at /home/edsradmin/software/php-8.0.0RC4/sapi/cli/php_cli.c:1336 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80371&edit=1

« previous php.bugs (#230370) next »