php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67735 PHPNG: segfault when running "composer update"
Submitted: 2014-08-01 10:56 UTC Modified: 2015-02-17 14:32 UTC
From: pascal dot chevrel at free dot fr Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pascal dot chevrel at free dot fr
New email:
PHP Version: OS:

 

 [2014-08-01 10:56 UTC] pascal dot chevrel at free dot fr
Description:
------------
I ran "composer update" in one of my projects and:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Erreur de segmentation (core dumped)

OS: Ubuntu 14.04

the Ubuntu crash report app says:
php5 crashed with SIGSEGV in _array_init()

Unfortunately, I can't copy/paste the report as the crash application doesn't allow that.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-02 16:21 UTC] jpauli@php.net
Unfortunately, we'll need a backtrace to debug that.

To generate a backtrace, please follow https://bugs.php.net/bugs-generating-backtrace.php
 [2014-08-07 23:33 UTC] pascal dot chevrel at free dot fr
FYI, the segfault no longer happen with the last .deb provided by Zend (PHP 5.7.0-dev (cli) (built: Aug  7 2014 16:17:33) 

But now the segfault happens with the use of Atoum.

I looked at the doc to generate a backtrace and it looks Chinese to me, sorry :)
 [2014-08-07 23:42 UTC] pascal dot chevrel at free dot fr
ok, I found out that Ubuntu keeps backtraces for crashes in /var/crash, how can I provide this file to you guys? I don't see an attachment feature on the bug tracker apart from the "attach a patch" one.
 [2014-08-11 14:10 UTC] imprec at gmail dot com
Just copy/paste the backtrace as bug comment
 [2014-08-11 14:24 UTC] tyrael@php.net
as Julien mentioned previously here is how to generate a backtrace from a coredump:
https://bugs.php.net/bugs-generating-backtrace.php
basically you call gdb (which assumes you have gdb installed and it is also advised to have the debug symbols installed otherwise the backtrace won't be much help) with the binary which was used to generate the dump (the php cli in your case) and the crashdump:
gdb /path/to/php /path/to/the/core/file
then from gdb you execute:
bt
then you can copypaste the backtrace to the bugreport.
 [2014-08-11 19:31 UTC] ingo dot walz at googlemail dot com
If you can provide additional information, I can try to reproduce it and generate the backtrace. 
I saw a really strange behaviour in atoum, but no segfault. 

I tried to run the atoum testsuite with phpng, installed via composer:

composer.json:
{
        "require": {
                "atoum/atoum": "*"
        }
}

$ wget https://getcomposer.org/composer.phar
$ ../phpng/bin/php composer.phar update
$ cd vendor/atoum/atoum/
$ ../phpng/bin/php scripts/runner.php --test-it
[ Skip ]
Error: Data provider mageekguy\atoum\tests\units\asserters\float::testIsNearlyEqualToDataProvider() is unknown

(linked to this condition https://github.com/atoum/atoum/blob/master/classes/test.php#L1310 )

The same with a regular git checkout (also with phpng):
$ git clone https://github.com/atoum/atoum .
$ ../phpng/bin/php scripts/runner.php --test-it
-> Works fine, no Exception

No errors with PHP 5.5.14 in both variants ... 

Following could be helpful:
- The atoum testfile, causing the segfault
- The version of atoum

I can provide the backtrace if I'm able to reproduce it. Not sure if we're talking about the same issue ...
 [2014-08-11 21:24 UTC] ingo dot walz at googlemail dot com
I got a backtrace running the composer test suite against phpng:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000009dbbbc in destroy_zend_class (pce=0x25c94b8)
    at /home/dev/phpng/php-src/Zend/zend_opcode.c:273
273		if (--ce->refcount > 0) {
(gdb) bt
#0  0x00000000009dbbbc in destroy_zend_class (pce=0x25c94b8)
    at /home/dev/phpng/php-src/Zend/zend_opcode.c:273
#1  0x0000000000a025ff in zend_hash_destroy (ht=0x22932a0)
    at /home/dev/phpng/php-src/Zend/zend_hash.c:548
#2  0x00000000009eb924 in compiler_globals_dtor (compiler_globals=0x2292ef0, 
    tsrm_ls=0x228fd30) at /home/dev/phpng/php-src/Zend/zend.c:544
#3  0x0000000000926017 in tsrm_shutdown ()
    at /home/dev/phpng/php-src/TSRM/TSRM.c:180
#4  0x0000000000ab7a6e in main (argc=4, argv=0x228fbe0)
    at /home/dev/phpng/php-src/sapi/cli/php_cli.c:1399

It happened with this data provider value:
https://github.com/composer/composer/blob/master/tests/Composer/Test/Repository/PearRepositoryTest.php#L94-L99
 [2014-08-22 13:11 UTC] pascal dot chevrel at free dot fr
Finally succeeded in compiling master on Ubuntu and generated a backtrace:
(gdb) bt
#0  0x00000000006ff2c5 in zend_fetch_debug_backtrace (return_value=return_value@entry=0x7f7e4472d550, skip_last=skip_last@entry=1, options=<optimized out>, limit=0)
    at /home/pascalc/repos/github/php-src/Zend/zend_builtin_functions.c:2443
#1  0x00000000006ff788 in zif_debug_backtrace (param_count=<optimized out>, return_value=0x7f7e4472d550) at /home/pascalc/repos/github/php-src/Zend/zend_builtin_functions.c:2567
#2  0x0000000000776ee0 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x7f7e4472d400) at /home/pascalc/repos/github/php-src/Zend/zend_vm_execute.h:595
#3  0x0000000000718070 in execute_ex (execute_data=0x7f7e4472d400) at /home/pascalc/repos/github/php-src/Zend/zend_vm_execute.h:354
#4  0x00000000006d5421 in zend_call_function (fci=fci@entry=0x7fff8aa63820, fci_cache=<optimized out>, fci_cache@entry=0x0) at /home/pascalc/repos/github/php-src/Zend/zend_execute_API.c:851
#5  0x00000000006d5818 in call_user_function_ex (function_table=<optimized out>, object=object@entry=0x0, function_name=function_name@entry=0x7fff8aa63980, 
    retval_ptr=retval_ptr@entry=0x7fff8aa63970, param_count=param_count@entry=5, params=params@entry=0x7fff8aa639c0, no_separation=no_separation@entry=1, symbol_table=symbol_table@entry=0x0)
    at /home/pascalc/repos/github/php-src/Zend/zend_execute_API.c:656
#6  0x00000000006e7034 in zend_error (type=type@entry=2, format=format@entry=0xadda2b "%s") at /home/pascalc/repos/github/php-src/Zend/zend.c:1205
#7  0x000000000067e2c1 in php_verror (docref=<optimized out>, params=<optimized out>, type=2, format=<optimized out>, args=args@entry=0x7fff8aa63bb8)
    at /home/pascalc/repos/github/php-src/main/main.c:920
#8  0x000000000067ea9d in php_error_docref1 (docref=docref@entry=0x0, param1=param1@entry=0x7f7e42938fa0 "/.atoum.php", type=type@entry=2, format=format@entry=0xa9cd27 "%s: %s")
    at /home/pascalc/repos/github/php-src/main/main.c:944
#9  0x00000000006967e0 in php_stream_display_wrapper_errors (wrapper=wrapper@entry=0xe11b80 <php_plain_files_wrapper>, path=path@entry=0x7f7e44816a04 "/.atoum.php", 
    caption=caption@entry=0xadfed9 "failed to open stream") at /home/pascalc/repos/github/php-src/main/streams/streams.c:225
#10 0x0000000000699752 in _php_stream_open_wrapper_ex (path=path@entry=0x7f7e44816a04 "/.atoum.php", mode=mode@entry=0xafb418 "rb", options=<optimized out>, 
    opened_path=opened_path@entry=0x7fff8aa63e70, context=context@entry=0x0) at /home/pascalc/repos/github/php-src/main/streams/streams.c:2148
#11 0x000000000067ed38 in php_stream_open_for_zend_ex (filename=0x7f7e44816a04 "/.atoum.php", handle=0x7fff8aa63e60, mode=<optimized out>) at /home/pascalc/repos/github/php-src/main/main.c:1392
#12 0x0000000000749fcb in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (execute_data=0x7f7e4472d300) at /home/pascalc/repos/github/php-src/Zend/zend_vm_execute.h:31321
#13 0x0000000000718070 in execute_ex (execute_data=0x7f7e4472d300) at /home/pascalc/repos/github/php-src/Zend/zend_vm_execute.h:354
#14 0x00000000006d5421 in zend_call_function (fci=fci@entry=0x7fff8aa64070, fci_cache=<optimized out>, fci_cache@entry=0x0) at /home/pascalc/repos/github/php-src/Zend/zend_execute_API.c:851
#15 0x00000000006d5818 in call_user_function_ex (function_table=<optimized out>, object=object@entry=0x0, function_name=<optimized out>, retval_ptr=retval_ptr@entry=0x7fff8aa64100, 
    param_count=<optimized out>, params=<optimized out>, no_separation=no_separation@entry=1, symbol_table=symbol_table@entry=0x0) at /home/pascalc/repos/github/php-src/Zend/zend_execute_API.c:656
#16 0x00000000006d5849 in call_user_function (function_table=<optimized out>, object=object@entry=0x0, function_name=<optimized out>, retval_ptr=retval_ptr@entry=0x7fff8aa64100, 
    param_count=<optimized out>, params=<optimized out>) at /home/pascalc/repos/github/php-src/Zend/zend_execute_API.c:638
#17 0x0000000000610f80 in user_shutdown_function_call (zv=<optimized out>) at /home/pascalc/repos/github/php-src/ext/standard/basic_functions.c:4869
#18 0x00000000006f80aa in zend_hash_apply (ht=0x7f7e448198a8, apply_func=apply_func@entry=0x610f10 <user_shutdown_function_call>) at /home/pascalc/repos/github/php-src/Zend/zend_hash.c:1022
#19 0x00000000006156f6 in php_call_shutdown_functions () at /home/pascalc/repos/github/php-src/ext/standard/basic_functions.c:4961
#20 0x000000000067f7bd in php_request_shutdown (dummy=dummy@entry=0x0) at /home/pascalc/repos/github/php-src/main/main.c:1803
#21 0x000000000077963a in do_cli (argc=4, argv=0x29f6870) at /home/pascalc/repos/github/php-src/sapi/cli/php_cli.c:1157
#22 0x000000000042e4e0 in main (argc=4, argv=0x29f6870) at /home/pascalc/repos/github/php-src/sapi/cli/php_cli.c:1358
 [2015-02-17 14:32 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2015-02-17 14:32 UTC] laruence@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 29 16:01:26 2025 UTC