Bug #78592 [Opn->Fbk]: filter related extension cause Segmentation fault
| From: | cmb@php.net | Date: | Fri, 02 Jul 2021 13:51:12 +0000 |
| Subject: | Bug #78592 [Opn->Fbk]: filter related extension cause Segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234765@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78592&edit=1
ID: 78592
Updated by: cmb@php.net
Reported by: john dot royer at gmail dot com
Summary: filter related extension cause Segmentation fault
-Status: Open
+Status: Feedback
Type: Bug
Package: JSON related
Operating System: Linux (Ubuntu 18.04)
PHP Version: 7.3.9
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Is this still an issue with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2019-09-26 10:33:40] john dot royer at gmail dot com
I think this may not PHP's error.
Please let me know if you need more information. Thanks.
------------------------------------------------------------------------
[2019-09-26 10:31:52] john dot royer at gmail dot com
I also get the segment fault issue in 7.2.22.
phpbrew build script: phpbrew install -j 8 7.2.22 as 72 +default +mysql +pdo +filter
$ php -v
PHP 7.2.22 (cli) (built: Sep 26 2019 16:54:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
fileinfo
filter
hash
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xslzip
zlib
$ phpunit
... Run by vendor/bin/phpunit ...
PHPUnit 7.5.15 by Sebastian Bergmann and contributors.
............................................................... 63 / 304 ( 20%)
................................Segmentation fault (core dumped)
//===============================================
$ gdb
which php core-php.730
GNU gdb (Ubuntu 8.1-0ubuntu3.1) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zero/.phpbrew/php/72/bin/php...done.
[New LWP 730]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php /home/zero/devel/boltics/vendor/bin/phpunit'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 zend_mm_alloc_small (bin_num=<optimized out>, size=56, heap=0x7f9626400040) at
/home/zero/.phpbrew/build/72/Zend/zend_alloc.c:1275
1275 heap->free_slot[bin_num] = p->next_free_slot;
(gdb)
#0 zend_mm_alloc_small (bin_num=<optimized out>, size=56, heap=0x7f9626400040) at
/home/zero/.phpbrew/build/72/Zend/zend_alloc.c:1275
#1 zend_mm_alloc_heap (size=56, heap=0x7f9626400040) at
/home/zero/.phpbrew/build/72/Zend/zend_alloc.c:1346
#2 _emalloc (size=size@entry=56) at /home/zero/.phpbrew/build/72/Zend/zend_alloc.c:2435
#3 0x000055db1ccde341 in zend_string_alloc (persistent=0, len=28) at
/home/zero/.phpbrew/build/72/Zend/zend_string.h:134
#4 php_json_scan (s=s@entry=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_scanner.c:593
#5 0x000055db1ccdcab7 in php_json_yylex (value=0x7ffc9a321060, parser=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_parser.tab.c:1905
#6 php_json_yyparse (parser=parser@entry=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_parser.tab.c:1367
#7 0x000055db1ccd98a1 in php_json_decode_ex (return_value=return_value@entry=0x7f9626423c20,
str=str@entry=0x7f9621042018 "{\n \"name\": \"boltics/core\",\n
\"description\": \"A secert project\",\n \"keywords\":
[\"cms\", \"plattform\", \"shopify\"],\n \"license\":
\"\",\n \"type\": \"project\",\n \"require\": {\n
\"php\": \">=7.1.3"..., str_len=<optimized out>,
options=<optimized out>,
depth=<optimized out>) at /home/zero/.phpbrew/build/72/ext/json/json.c:216
#8 0x000055db1ccd99f5 in zif_json_decode (execute_data=0x7f9626423d30, return_value=0x7f9626423c20)
at /home/zero/.phpbrew/build/72/ext/json/json.c:306
#9 0x000055db1cfaaca0 in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER () at
/home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:816
#10 execute_ex (ex=0x38) at /home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:59762
#11 0x000055db1cfac579 in zend_execute (op_array=op_array@entry=0x7f96264802a0, return_value=0x0,
return_value@entry=0x7f96253eca20)
at /home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:63776
#12 0x000055db1cefbd22 in zend_execute_scripts (type=type@entry=8, retval=0x7f96253eca20,
retval@entry=0x0, file_count=641874736, file_count@entry=3)
at /home/zero/.phpbrew/build/72/Zend/zend.c:1498
#13 0x000055db1ce97d50 in php_execute_script (primary_file=0x7ffc9a324cf0) at
/home/zero/.phpbrew/build/72/main/main.c:2599
#14 0x000055db1cfae98c in do_cli (argc=2, argv=0x55db1f559490) at
/home/zero/.phpbrew/build/72/sapi/cli/php_cli.c:1011
#15 0x000055db1cbe556b in main (argc=2, argv=0x55db1f559490) at
/home/zero/.phpbrew/build/72/sapi/cli/php_cli.c:1403
(gdb)
#0 zend_mm_alloc_small (bin_num=<optimized out>, size=56, heap=0x7f9626400040) at
/home/zero/.phpbrew/build/72/Zend/zend_alloc.c:1275
#1 zend_mm_alloc_heap (size=56, heap=0x7f9626400040) at
/home/zero/.phpbrew/build/72/Zend/zend_alloc.c:1346
#2 _emalloc (size=size@entry=56) at /home/zero/.phpbrew/build/72/Zend/zend_alloc.c:2435
#3 0x000055db1ccde341 in zend_string_alloc (persistent=0, len=28) at
/home/zero/.phpbrew/build/72/Zend/zend_string.h:134
#4 php_json_scan (s=s@entry=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_scanner.c:593
#5 0x000055db1ccdcab7 in php_json_yylex (value=0x7ffc9a321060, parser=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_parser.tab.c:1905
#6 php_json_yyparse (parser=parser@entry=0x7ffc9a322540) at
/home/zero/.phpbrew/build/72/ext/json/json_parser.tab.c:1367
#7 0x000055db1ccd98a1 in php_json_decode_ex (return_value=return_value@entry=0x7f9626423c20,
str=str@entry=0x7f9621042018 "{\n \"name\": \"boltics/core\",\n
\"description\": \"A secert project\",\n \"keywords\":
[\"cms\", \"plattform\", \"shopify\"],\n \"license\":
\"\",\n \"type\": \"project\",\n \"require\": {\n
\"php\": \">=7.1.3"..., str_len=<optimized out>,
options=<optimized out>,
depth=<optimized out>) at /home/zero/.phpbrew/build/72/ext/json/json.c:216
#8 0x000055db1ccd99f5 in zif_json_decode (execute_data=0x7f9626423d30, return_value=0x7f9626423c20)
at /home/zero/.phpbrew/build/72/ext/json/json.c:306
#9 0x000055db1cfaaca0 in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER () at
/home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:816
#10 execute_ex (ex=0x38) at /home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:59762
#11 0x000055db1cfac579 in zend_execute (op_array=op_array@entry=0x7f96264802a0, return_value=0x0,
return_value@entry=0x7f96253eca20)
at /home/zero/.phpbrew/build/72/Zend/zend_vm_execute.h:63776
#12 0x000055db1cefbd22 in zend_execute_scripts (type=type@entry=8, retval=0x7f96253eca20,
retval@entry=0x0, file_count=641874736, file_count@entry=3)
at /home/zero/.phpbrew/build/72/Zend/zend.c:1498
#13 0x000055db1ce97d50 in php_execute_script (primary_file=0x7ffc9a324cf0) at
/home/zero/.phpbrew/build/72/main/main.c:2599
#14 0x000055db1cfae98c in do_cli (argc=2, argv=0x55db1f559490) at
/home/zero/.phpbrew/build/72/sapi/cli/php_cli.c:1011
#15 0x000055db1cbe556b in main (argc=2, argv=0x55db1f559490) at
/home/zero/.phpbrew/build/72/sapi/cli/php_cli.c:1403
------------------------------------------------------------------------
[2019-09-26 08:27:50] john dot royer at gmail dot com
My friend is using PHP 7.3.7 and running the same unit test, his PHP works just fine.
For me, most PHP 7.3.x gets segment fault.
I wonder if the problem is not in PHP layer ?
------------------------------------------------------------------------
[2019-09-26 06:01:32] john dot royer at gmail dot com
information update: I notice that PHP 7.3.8 has same issue.
phpbrew build script: phpbrew install -j 8 7.3.8 +cli +json +pdo +xml +curl +mysql +hash +ctype
+openssl +filter
$ php -v
PHP 7.3.8 (cli) (built: Sep 26 2019 13:51:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
$ php -m
[PHP Modules]
Core
ctype
curl
date
dom
filter
hash
json
libxml
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
Phar
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
zlib
$ phpunit
... Run by vendor/bin/phpunit ...
PHPUnit 7.5.15 by Sebastian Bergmann and contributors.
...........................................................Segmentation fault (core dumped)
$ gdb which php core-php.17346
GNU gdb (Ubuntu 8.1-0ubuntu3.1) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/zero/.phpbrew/php/738/bin/php...done.
[New LWP 17346]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php /home/zero/devel/boltics/vendor/bin/phpunit'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 zend_mm_alloc_small (bin_num=6, size=56, heap=0x7f2840e00040) at
/home/zero/.phpbrew/build/738/Zend/zend_alloc.c:1289
1289 heap->free_slot[bin_num] = p->next_free_slot;
(gdb) bt
#0 zend_mm_alloc_small (bin_num=6, size=56, heap=0x7f2840e00040) at
/home/zero/.phpbrew/build/738/Zend/zend_alloc.c:1289
#1 _emalloc_56 () at /home/zero/.phpbrew/build/738/Zend/zend_alloc.c:2423
#2 0x000055f67fdbb389 in _zend_new_array_0 () at /home/zero/.phpbrew/build/738/Zend/zend_hash.c:217
#3 0x000055f67fdc8bb2 in zend_fetch_debug_backtrace
(return_value=return_value@entry=0x7ffda26668e0, skip_last=skip_last@entry=0,
options=options@entry=0, limit=limit@entry=0) at
/home/zero/.phpbrew/build/738/Zend/zend_builtin_functions.c:2498
#4 0x000055f67fdcfdaf in zend_default_exception_new_ex (class_type=0x55f680d85580,
skip_top_traces=0)
at /home/zero/.phpbrew/build/738/Zend/zend_exceptions.c:215
#5 0x000055f67fdb0eab in object_and_properties_init (arg=arg@entry=0x7ffda2666960,
class_type=class_type@entry=0x55f680d85580,
properties=properties@entry=0x0) at /home/zero/.phpbrew/build/738/Zend/zend_API.c:1335
#6 0x000055f67fdb0fa7 in object_init_ex (arg=arg@entry=0x7ffda2666960,
class_type=class_type@entry=0x55f680d85580)
at /home/zero/.phpbrew/build/738/Zend/zend_API.c:1343
#7 0x000055f67fb0d696 in zend_throw_exception (exception_ce=exception_ce@entry=0x55f680d85580,
message=0x7f283eafa500 "Class Query executed does not exist", code=code@entry=-1)
at /home/zero/.phpbrew/build/738/Zend/zend_exceptions.c:909
#8 0x000055f67fb0d84d in zend_throw_exception_ex (exception_ce=0x55f680d85580, code=code@entry=-1,
format=format@entry=0x55f67ff4480e "Class %s does not exist") at
/home/zero/.phpbrew/build/738/Zend/zend_exceptions.c:936
#9 0x000055f67fc6227d in reflection_class_object_ctor (execute_data=0x7f2840e26b50,
is_object=<optimized out>, return_value=<optimized out>)
at /home/zero/.phpbrew/build/738/ext/reflection/php_reflection.c:3744
#10 0x000055f67fe3c455 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at
/home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:980
#11 execute_ex (ex=0x7f2840e00040) at /home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:55485
#12 0x000055f67fda195b in zend_call_function (fci=fci@entry=0x7ffda2666ce0, fci_cache=<optimized
out>, fci_cache@entry=0x7ffda2666cc0)
at /home/zero/.phpbrew/build/738/Zend/zend_execute_API.c:756
#13 0x000055f67fde1b33 in zend_std_call_getter (zobj=zobj@entry=0x7f2837e76a80,
prop_name=prop_name@entry=0x7f2840ffac40,
retval=retval@entry=0x7f2840e255a0) at
/home/zero/.phpbrew/build/738/Zend/zend_object_handlers.c:206
#14 0x000055f67fde35de in zend_std_read_property (object=<optimized out>, member=<optimized
out>, type=0, cache_slot=<optimized out>,
rv=0x7f2840e255a0) at /home/zero/.phpbrew/build/738/Zend/zend_object_handlers.c:706
#15 0x000055f67fdf74de in ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_HANDLER () at
/home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:13586
#16 0x000055f67fe3696d in execute_ex (ex=0x7f2840e00040) at
/home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:56931
#17 0x000055f67fda195b in zend_call_function (fci=fci@entry=0x7ffda2666fc0, fci_cache=<optimized
out>, fci_cache@entry=0x7ffda2666fa0)
at /home/zero/.phpbrew/build/738/Zend/zend_execute_API.c:756
#18 0x000055f67fcb6db5 in zif_call_user_func_array (execute_data=0x7f2840e253b0,
return_value=0x7f2840e253a0)
at /home/zero/.phpbrew/build/738/ext/standard/basic_functions.c:4942
#19 0x000055f67fe3b45e in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER () at
/home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:892
#20 execute_ex (ex=0x7f2840e00040) at /home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:55481
#21 0x000055f67fe3d57e in zend_execute (op_array=op_array@entry=0x7f2840e812a0, return_value=0x0,
return_value@entry=0x7f283faa9680)
at /home/zero/.phpbrew/build/738/Zend/zend_vm_execute.h:60881
#22 0x000055f67fdaf512 in zend_execute_scripts (type=type@entry=8, retval=0x7f283faa9680,
retval@entry=0x0, file_count=1088574176,
file_count@entry=3) at /home/zero/.phpbrew/build/738/Zend/zend.c:1568
#23 0x000055f67fd4fca0 in php_execute_script (primary_file=0x7ffda2669690) at
/home/zero/.phpbrew/build/738/main/main.c:2634
#24 0x000055f67fe3fa5c in do_cli (argc=2, argv=0x55f680c29490) at
/home/zero/.phpbrew/build/738/sapi/cli/php_cli.c:997
#25 0x000055f67fb1c62b in main (argc=2, argv=0x55f680c29490) at
/home/zero/.phpbrew/build/738/sapi/cli/php_cli.c:1389
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78592
--
Edit this bug report at https://bugs.php.net/bug.php?id=78592&edit=1