Bug #71712 [NEW]: Segmentation fault on ReflectionClass::newInstanceArgs

From: Date: Fri, 04 Mar 2016 13:00:31 +0000
Subject: Bug #71712 [NEW]: Segmentation fault on ReflectionClass::newInstanceArgs
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199592@lists.php.net to get a copy of this message
From: bashofmann at gmail dot com Operating system: Ubuntu 14.04 PHP version: 7.0.4 Package: Reproducible crash Bug Type: Bug Bug description:Segmentation fault on ReflectionClass::newInstanceArgs Description: ------------ We get the following reproducible segmentation fault when running a unit test that is mocking some class which results in a ReflectionClass::newInstanceArgs. Unfortunately I was not able to reproduce this with a smaller sample script. Is this backtrace enough to find the cause and fix it? GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 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/researchgate/.phpbrew/php/php-7.0.4/bin/php...done. [New LWP 16027] [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 bin/phpunit test/unit/modules/literature/classes/ClaimingServiceTest.php'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x000000000084ad49 in zend_mm_alloc_small (heap=0x7fd514800040, size=40, bin_num=4, __zend_filename=0xe9ec78 "/home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_opcode.c", __zend_lineno=59, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_alloc.c:1291 1291 heap->free_slot[bin_num] = p->next_free_slot; Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module> from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named 'libstdcxx' (gdb) bt #0 0x000000000084ad49 in zend_mm_alloc_small (heap=0x7fd514800040, size=40, bin_num=4, __zend_filename=0xe9ec78 "/home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_opcode.c", __zend_lineno=59, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_alloc.c:1291 #1 0x000000000084afa0 in zend_mm_alloc_heap (heap=0x7fd514800040, size=40, __zend_filename=0xe9ec78 "/home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_opcode.c", __zend_lineno=59, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_alloc.c:1358 #2 0x000000000084da03 in _emalloc (size=4, __zend_filename=0xe9ec78 "/home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_opcode.c", __zend_lineno=59, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_alloc.c:2442 #3 0x000000000086d2ca in init_op_array (op_array=0x7fd50ff73040, type=2 '\002', initial_ops_size=64) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_opcode.c:59 #4 0x000000000085c724 in zend_compile_func_decl (result=0x0, ast=0x7fd51181ba00) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:4858 #5 0x000000000086335d in zend_compile_stmt (ast=0x7fd51181ba00) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:7065 #6 0x000000000085ac80 in zend_compile_stmt_list (ast=0x7fd51181bb48) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:4358 #7 0x0000000000863226 in zend_compile_stmt (ast=0x7fd51181bb48) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:7009 #8 0x000000000085db91 in zend_compile_class_decl (ast=0x7fd51181bb98) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:5305 #9 0x000000000086339e in zend_compile_stmt (ast=0x7fd51181bb98) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:7077 #10 0x0000000000862fd5 in zend_compile_top_stmt (ast=0x7fd51181bb98) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:6983 #11 0x0000000000862fb7 in zend_compile_top_stmt (ast=0x7fd51181bbe0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_compile.c:6978 #12 0x0000000000827fa6 in compile_file (file_handle=0x7ffd37faa370, type=2) at Zend/zend_language_scanner.l:607 #13 0x00000000006864f8 in phar_compile_file (file_handle=0x7ffd37faa370, type=2) at /home/researchgate/.phpbrew/build/php-7.0.4/ext/phar/phar.c:3311 #14 0x0000000000828155 in compile_filename (type=2, filename=0x7fd514821640) at Zend/zend_language_scanner.l:647 #15 0x000000000091852e in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER () at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:29135 #16 0x00000000008dc2cc in execute_ex (ex=0x7fd514821530) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:414 #17 0x0000000000869b52 in zend_call_function (fci=0x7ffd37faa770, fci_cache=0x7ffd37faa740) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_execute_API.c:860 #18 0x00000000008a6df6 in zend_call_method (object=0x7fd511a6cbe8, obj_ce=0x7fd514802620, fn_proxy=0x7fd511a6cbe0, function_name=0x7fd511e025c8 "composer\\autoload\\classloader::loadclass\001", function_name_len=44, retval_ptr=0x0, param_count=1, arg1=0x7fd514821520, arg2=0x0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_interfaces.c:104 #19 0x00000000006dc1c3 in zif_spl_autoload_call (execute_data=0x7fd5148214c0, return_value=0x7ffd37faaa40) at /home/researchgate/.phpbrew/build/php-7.0.4/ext/spl/php_spl.c:429 #20 0x0000000000869c79 in zend_call_function (fci=0x7ffd37faaa80, fci_cache=0x7ffd37faaa50) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_execute_API.c:879 #21 0x000000000086a3f7 in zend_lookup_class_ex (name=0x7fd511ed8850, key=0x7fd510f88540, use_autoload=1) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_execute_API.c:1041 #22 0x000000000086af40 in zend_fetch_class_by_name (class_name=0x7fd511ed8850, key=0x7fd510f88540, fetch_type=512) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_execute_API.c:1387 #23 0x00000000008e3b3a in ZEND_NEW_SPEC_CONST_HANDLER () at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:3354 #24 0x00000000008dc2cc in execute_ex (ex=0x7fd514820a60) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:414 #25 0x0000000000869b52 in zend_call_function (fci=0x7ffd37faade0, fci_cache=0x7ffd37faadb0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_execute_API.c:860 #26 0x00000000006b1c3b in zim_reflection_class_newInstanceArgs (execute_data=0x7fd5148209f0, return_value=0x7fd5148207c0) at /home/researchgate/.phpbrew/build/php-7.0.4/ext/reflection/php_reflection.c:4743 #27 0x00000000008dd44a in ZEND_DO_FCALL_SPEC_HANDLER () at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:842 #28 0x00000000008dc2cc in execute_ex (ex=0x7fd514813030) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:414 #29 0x00000000008dc3de in zend_execute (op_array=0x7fd514877100, return_value=0x0) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend_vm_execute.h:458 #30 0x0000000000881214 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/researchgate/.phpbrew/build/php-7.0.4/Zend/zend.c:1427 #31 0x00000000007ee5cd in php_execute_script (primary_file=0x7ffd37fad430) at /home/researchgate/.phpbrew/build/php-7.0.4/main/main.c:2484 #32 0x0000000000940756 in do_cli (argc=3, argv=0x1b0e010) at /home/researchgate/.phpbrew/build/php-7.0.4/sapi/cli/php_cli.c:974 #33 0x000000000094191a in main (argc=3, argv=0x1b0e010) at /home/researchgate/.phpbrew/build/php-7.0.4/sapi/cli/php_cli.c:1345 -- Edit bug report at https://bugs.php.net/bug.php?id=71712&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71712&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71712&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71712&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71712&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71712&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71712&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71712&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71712&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71712&r=support Expected behavior: https://bugs.php.net/fix.php?id=71712&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71712&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71712&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71712&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71712&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71712&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71712&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71712&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71712&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71712&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71712&r=mysqlcfg

« previous php.bugs (#199592) next »