Page MenuHomePhabricator

./bin/repository update - throws segfault
Closed, DuplicatePublic

Description

Hi,

the phpinfo for my system: https://paste.pound-python.org/show/fHMpAlnzW24jb7oCNhkE

phabricator
    c3bdcb4ca85487921909f0202aa760e8ed61404a (Sun, Feb 5) (branched from 9c62a10989e03e518f855de3fc0a610543287c71 on origin) 
arcanist
    67a47acebd6b5e5809745db12955ad251c66004e (Mon, Feb 13) (branched from 224986af634e1dfc40916e5baee76897db4c907f on origin) 
phutil
    58fb3b94464e1c00d0f348d1501bec6b8690253c (Mon, Feb 13) (branched from 82f71f62129bc19f28aeed8c660c931e512a66e7 on origin)
# coredumpctl gdb 20917
           PID: 20917 (php)
           UID: 2016 (phab)
           GID: 2016 (phab)
        Signal: 11 (SEGV)
     Timestamp: Di 2017-02-14 08:32:08 CET (19s ago)
  Command Line: php /srv/phab/phabricator/bin/repository update -- rOL
    Executable: /usr/lib64/php7.1/bin/php
 Control Group: /system.slice/phd.service
          Unit: phd.service
         Slice: system.slice
       Boot ID: d32e92c1cc134838aee1d477d054d26a
    Machine ID: 4a76fc793097f21873d0e38754d384fc
      Hostname: alpha.web
      Coredump: /var/lib/systemd/coredump/core.php.2016.d32e92c1cc134838aee1d477d054d26a.20917.1487057528000000.lz4
       Message: Process 20917 (php) of user 2016 dumped core.
                
                Stack trace of thread 20917:
                #0  0x0000000000a35157 zend_mm_alloc_small (php)
                #1  0x0000000000a35437 zend_mm_alloc_heap (php)
                #2  0x0000000000a38200 _emalloc (php)
                #3  0x00000000009f867b zend_string_alloc (php)
                #4  0x00000000009f86f0 zend_string_init (php)
                #5  0x0000000000a054c1 lex_scan (php)
                #6  0x0000000000a40e0c zendlex (php)
                #7  0x00000000009f3571 zendparse (php)
                #8  0x00000000009fbcc9 zend_compile (php)
                #9  0x00000000009fc0a2 compile_file (php)
                #10 0x0000000000702804 phar_compile_file (php)
                #11 0x0000000000af044d zend_include_or_eval (php)
                #12 0x0000000000b469b5 ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (php)
                #13 0x0000000000af0801 execute_ex (php)
                #14 0x0000000000a612c9 zend_call_function (php)
                #15 0x0000000000aacf98 zend_call_method (php)
                #16 0x00000000007b9220 zif_spl_autoload_call (php)
                #17 0x0000000000a61416 zend_call_function (php)
                #18 0x0000000000a61e50 zend_lookup_class_ex (php)
                #19 0x0000000000a62ea9 zend_fetch_class_by_name (php)
                #20 0x0000000000af96be ZEND_NEW_SPEC_CONST_HANDLER (php)
                #21 0x0000000000af0801 execute_ex (php)
                #22 0x0000000000af0a10 zend_execute (php)
                #23 0x0000000000a7e03f zend_execute_scripts (php)
                #24 0x00000000009b6eb5 php_execute_script (php)
                #25 0x0000000000b8743e do_cli (php)
                #26 0x0000000000b887cb main (php)
                #27 0x00007f2d366bf790 __libc_start_main (libc.so.6)
                #28 0x000000000048e2e9 _start (php)

GNU gdb (Gentoo 7.10.1 vanilla) 7.10.1
Copyright (C) 2015 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
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 /usr/lib64/php7.1/bin/php...Reading symbols from /usr/lib64/debug//usr/lib64/php7.1/bin/php.debug...done.
done.
[New LWP 20917]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `php /srv/phab/phabricator/bin/repository update -- rOL'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000a35157 in zend_mm_alloc_small (heap=0x7f2d33a00040, size=64, bin_num=7, __zend_filename=0x10d2058 "/var/tmp/portage/dev-lang/php-7.1.1/work/sapis-build/cli/Zend/zend_string.h", __zend_lineno=122, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_alloc.c:1261
1261                    heap->free_slot[bin_num] = p->next_free_slot;
(gdb) bt
#0  0x0000000000a35157 in zend_mm_alloc_small (heap=0x7f2d33a00040, size=64, bin_num=7, __zend_filename=0x10d2058 "/var/tmp/portage/dev-lang/php-7.1.1/work/sapis-build/cli/Zend/zend_string.h", __zend_lineno=122, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_alloc.c:1261
#1  0x0000000000a35437 in zend_mm_alloc_heap (heap=0x7f2d33a00040, size=64, __zend_filename=0x10d2058 "/var/tmp/portage/dev-lang/php-7.1.1/work/sapis-build/cli/Zend/zend_string.h", __zend_lineno=122, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_alloc.c:1332
#2  0x0000000000a38200 in _emalloc (size=32, __zend_filename=0x10d2058 "/var/tmp/portage/dev-lang/php-7.1.1/work/sapis-build/cli/Zend/zend_string.h", __zend_lineno=122, __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_alloc.c:2417
#3  0x00000000009f867b in zend_string_alloc (len=5, persistent=0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_string.h:122
#4  0x00000000009f86f0 in zend_string_init (str=0x7f2d3b91f466 <error: Cannot access memory at address 0x7f2d3b91f466>, len=5, persistent=0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_string.h:158
#5  0x0000000000a054c1 in lex_scan (zendlval=0x7ffcce74f6c0) at Zend/zend_language_scanner.l:1893
#6  0x0000000000a40e0c in zendlex (elem=0x7ffcce74f720) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_compile.c:1701
#7  0x00000000009f3571 in zendparse () at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_language_parser.c:4450
#8  0x00000000009fbcc9 in zend_compile (type=2) at Zend/zend_language_scanner.l:585
#9  0x00000000009fc0a2 in compile_file (file_handle=0x7ffcce750430, type=2) at Zend/zend_language_scanner.l:635
#10 0x0000000000702804 in phar_compile_file (file_handle=0x7ffcce750430, type=2) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/ext/phar/phar.c:3318
#11 0x0000000000af044d in zend_include_or_eval (inc_filename=0x7f2d33a17cd0, type=4) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_execute.c:2822
#12 0x0000000000b469b5 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER () at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_vm_execute.h:35455
#13 0x0000000000af0801 in execute_ex (ex=0x7f2d33a16f30) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_vm_execute.h:429
#14 0x0000000000a612c9 in zend_call_function (fci=0x7ffcce7507a0, fci_cache=0x7ffcce750770) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_execute_API.c:828
#15 0x0000000000aacf98 in zend_call_method (object=0x0, obj_ce=0x0, fn_proxy=0x7f2d33a979b0, function_name=0x7f2d33a97928 "__phutil_autoload", function_name_len=17, retval_ptr=0x0, param_count=1, arg1=0x7f2d33a16f20, arg2=0x0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_interfaces.c:101
#16 0x00000000007b9220 in zif_spl_autoload_call (execute_data=0x7f2d33a16ed0, return_value=0x7ffcce750a50) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/ext/spl/php_spl.c:408
#17 0x0000000000a61416 in zend_call_function (fci=0x7ffcce750a90, fci_cache=0x7ffcce750a60) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_execute_API.c:842
#18 0x0000000000a61e50 in zend_lookup_class_ex (name=0x7f2d303965a0, key=0x7f2d303c5510, use_autoload=1) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_execute_API.c:1001
#19 0x0000000000a62ea9 in zend_fetch_class_by_name (class_name=0x7f2d303965a0, key=0x7f2d303c5510, fetch_type=512) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_execute_API.c:1436
#20 0x0000000000af96be in ZEND_NEW_SPEC_CONST_HANDLER () at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_vm_execute.h:3193
#21 0x0000000000af0801 in execute_ex (ex=0x7f2d33a15030) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_vm_execute.h:429
#22 0x0000000000af0a10 in zend_execute (op_array=0x7f2d33a7b000, return_value=0x0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend_vm_execute.h:474
#23 0x0000000000a7e03f in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/Zend/zend.c:1474
#24 0x00000000009b6eb5 in php_execute_script (primary_file=0x7ffcce7531f0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/main/main.c:2537
#25 0x0000000000b8743e in do_cli (argc=5, argv=0x2ebd2c0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/sapi/cli/php_cli.c:993
#26 0x0000000000b887cb in main (argc=5, argv=0x2ebd2c0) at /usr/src/debug/dev-lang/php-7.1.1/sapis-build/cli/sapi/cli/php_cli.c:1381

Event Timeline

I'm going to merge this into T12196; this is almost certainly an issue with PHP7. Upgrading to PHP 7.1.2 may resolve it.

The backtrace shows a segfault inside PHP's parser/scanner, which seems pretty unlikely to be something inside our control.