Bug #70805 [Com]: Segmentation faults whilst running Drupal 8 test suite

From: Date: Wed, 28 Oct 2015 17:57:18 +0000
Subject: Bug #70805 [Com]: Segmentation faults whilst running Drupal 8 test suite
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196859@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70805&edit=1 ID: 70805 Comment by: fabian at tag1consulting dot com Reported by: alex dot a dot pott at gmail dot com Summary: Segmentation faults whilst running Drupal 8 test suite Status: Open Type: Bug Package: Reproducible crash Operating System: OS X & Linux PHP Version: 7.0.0RC5 Block user comment: N Private report: N New Comment: I just confirmed that this is a GC problem: a) The graph implementation, which is really simple leaks memory - so directed references are not resolved correctly. b) Disabling the GC via disable_gc() during the graph operation fixes the segfault. I assume this is just happening very late in a process, because we first garbage collect wrongly, so memory is leaked and then we suddenly garbage collect _during_ the graph creation and that wracks havoc, which also means the backtrace makes sense. Previous Comments: ------------------------------------------------------------------------ [2015-10-28 15:01:13] neclimdul at gmail dot com The exact line trigging this is _really_ deep which is making it hard to simplify. I've tried a couple things but haven't made headway. The code is in Symfony and is making a graph of services. The exact line on the test I was looking at was: <?php public function addOutEdge(ServiceReferenceGraphEdge $edge) { $this->outEdges[] = $edge; } ?> I can setup a test environment and give someone access if they want to step through the failure. ------------------------------------------------------------------------ [2015-10-28 13:07:23] alex dot a dot pott at gmail dot com Description: ------------ When running certain Drupal 8 tests on PHP7 we get a segmentation fault. This does not occur on PHP5.* * thread #1: tid = 0x0000, 0x00000001055c6264 php`_emalloc_56 + 36 at zend_alloc.c:1291, stop reason = signal SIGSTOP frame #0: 0x00000001055c6264 php`_emalloc_56 + 36 at zend_alloc.c:1291 1288 1289 if (EXPECTED(heap->free_slot[bin_num] != NULL)) { 1290 zend_mm_free_slot *p = heap->free_slot[bin_num]; -> 1291 heap->free_slot[bin_num] = p->next_free_slot; 1292 return (void*)p; 1293 } else { 1294 return zend_mm_alloc_small_slow(heap, bin_num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); * frame #0: 0x00000001055c6264 php`_emalloc_56 + 36 at zend_alloc.c:1291 frame #1: 0x00000001055c6240 php`_emalloc_56 + 16 at zend_alloc.c:2361 frame #2: 0x0000000105601f36 php`zend_array_dup(source=0x0000000106d208c0) + 22 at zend_hash.c:1716 frame #3: 0x000000010566b840 php`ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(execute_data=0x000000010681aee0) + 112 at zend_vm_execute.h:18975 frame #4: 0x0000000105630298 php`execute_ex(ex=<unavailable>) + 40 at zend_vm_execute.h:417 frame #5: 0x00000001056306be php`zend_execute(op_array=<unavailable>, return_value=<unavailable>) + 1038 at zend_vm_execute.h:458 frame #6: 0x00000001055ef3ab php`zend_execute_scripts(type=8, retval=0x0000000000000000, file_count=3) + 315 at zend.c:1428 frame #7: 0x000000010558b7f4 php`php_execute_script(primary_file=0x00007fff5a9f82b0) + 852 at main.c:2471 frame #8: 0x0000000105682b60 php`do_cli(argc=<unavailable>, argv=<unavailable>) + 4048 at php_cli.c:974 frame #9: 0x0000000105681a17 php`main(argc=<unavailable>, argv=<unavailable>) + 1399 at php_cli.c:1345 frame #10: 0x00007fff8a9e65c9 libdyld.dylib`start + 1 Test script: --------------- 1. Install Drupal 8 from https://www.drupal.org/node/3060 (you will need a lamp stack or equivalent) 2. create the directory sites/simpletest 3. Enable the simpletest module once you have installed Drupal 8 (http://YOURSITE/admin/modules) 4a. Run the BasicAuthTest test from http://YOURSITE/admin/config/development/testing OR 4b. Run from the command line using php ./core/scripts/run-tests.sh --color --non-html --url http://YOURSITE/ --verbose --class 'Drupal\basic_auth\Tests\Authentication\BasicAuthTest' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70805&edit=1

« previous php.bugs (#196859) next »