View Issue Details

IDProjectCategoryView StatusLast Update
0001239XdebugUncategorizedpublic2016-01-25 21:59
Reporterderick Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.4.0rc3 
Target Version2.4.0Fixed in Version2.4.0rc4 
Summary0001239: Xdebug on PHP 7.1-dev, crashes due to changes with the CATCH opcode's jump mechanism
Description

Instead of using an absolute jump end point, it now uses a relative one just like FE_FETCH.

Steps To Reproduce

Test case:
Test for bug 0001034: path coverage [3] (>= PHP 7.0) [tests/bug01034-003-php70.phpt]

TagsNo tags attached.
Operating System
PHP Version7.1-dev

Activities

derick

2016-01-12 09:05

administrator   ~0003406

From 0001246:

Having latest php 7 from master with latest xdebug from master without any other extension, running codecoverage fails inside many different env, from travis to Rasmus'es php7dev vagrant box.

bt, core dump and all necessary code to reproduce is in my repo in xdebug_codecov_segfault branch, e.g. here is bt: https://github.com/pinepain/php-weak-lib/blob/xdebug_codecov_segfault/bt-php.26162

To reproduce just run

git clone git@github.com:pinepain/php-weak-lib.git
cd php-weak-lib
git checkout xdebug_codecov_segfault
composer install
vendor/bin/phpunit --coverage-text --configuration phpunit.xml

derick

2016-01-12 09:05

administrator   ~0003407

From 0001246:

zaq178miami - When I run your stuff, I only get:

derick@whisky:/tmp/php-weak-lib $ valgrind php vendor/bin/phpunit --coverage-text --configuration phpunit.xml
==11038== Memcheck, a memory error detector
==11038== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==11038== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==11038== Command: php vendor/bin/phpunit --coverage-text --configuration phpunit.xml
==11038==
PHPUnit 5.1.4 by Sebastian Bergmann and contributors.

EEEE
Fatal error: Uncaught Exception: Prevent weakref handler to be executed in /tmp/php-weak-lib/tests/SplObjectStorageTest.php on line 105

Exception: Prevent weakref handler to be executed in /tmp/php-weak-lib/tests/SplObjectStorageTest.php on line 105

Call Stack:
0.3970 0 1. {main}() /tmp/php-weak-lib/vendor/phpunit/phpunit/phpunit:0
1.5877 0 2. PHPUnit_TextUI_Command::main() /tmp/php-weak-lib/vendor/phpunit/phpunit/phpunit:47
1.5990 0 3. PHPUnit_TextUI_Command->run() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/Command.php:106
5.1157 0 4. PHPUnit_TextUI_TestRunner->doRun() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/Command.php:155
5.5340 0 5. PHPUnit_Framework_TestSuite->run() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:429
8.8604 0 6. PHPUnit_Framework_TestSuite->run() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
10.2334 0 7. PHPUnit_Framework_TestCase->run() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
10.2344 0 8. PHPUnit_Framework_TestResult->run() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestCase.php:726
10.3703 0 9. {anonymous-class:/tmp/php-weak-lib/tests/SplObjectStorageTest.php:101-107}->__destruct() /tmp/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestResult.php:702

==11038==
==11038== HEAP SUMMARY:
==11038== in use at exit: 168,873 bytes in 2,763 blocks
==11038== total heap usage: 252,504 allocs, 249,741 frees, 33,395,136 bytes allocated
==11038==
==11038== LEAK SUMMARY:
==11038== definitely lost: 3,273 bytes in 20 blocks
==11038== indirectly lost: 5,420 bytes in 12 blocks
==11038== possibly lost: 2,624 bytes in 1 blocks
==11038== still reachable: 157,556 bytes in 2,730 blocks
==11038== suppressed: 0 bytes in 0 blocks
==11038== Rerun with --leak-check=full to see details of leaked memory
==11038==
==11038== For counts of detected and suppressed errors, rerun with: -v
==11038== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

No segfault or anything.

derick

2016-01-12 09:06

administrator   ~0003408

From 0001246:

Thanks for looking into my problem!

Which php version do you run? I use debug zts from php-src master.

$ php -v
PHP 7.1.0-dev (cli) (built: Jan 11 2016 01:41:57) ( ZTS DEBUG )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0RC4-dev, Copyright (c) 2002-2015, by Derick Rethans

xdebug is also from xdebug/xdebug master

vagrant@php7dev:~/Development/xdebug$ git remote -v
origin git@github.com:xdebug/xdebug.git (fetch)
origin git@github.com:xdebug/xdebug.git (push)
vagrant@php7dev:~/Development/xdebug$ git fetch
vagrant@php7dev:~/Development/xdebug$ git pull
git brAlready up-to-date.
vagrant@php7dev:~/Development/xdebug$ git branch -v

commit 12c158ec62eaa2e0fa1cf2ad81af974fab188818
Author: Derick Rethans github@derickrethans.nl
Date: Sun Jan 10 23:34:42 2016 +0000

Fixed issue #1245: xdebug_dump_superglobals dumps *uninitialized* with PHP 7

vagrant@php7dev:~/Development/xdebug$

You may check this build - https://travis-ci.org/pinepain/php-weak-lib/builds/101715556 which fails too, i guess they also run xdebug from master. There are also bt provided.

derick

2016-01-12 09:06

administrator   ~0003409

From 0001246:

Just tried on freshest debug zts build from php-src:

vagrant@php7dev:~/Development/php-weak-lib$ php vendor/bin/phpunit --coverage-text --configuration phpunit.xml
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.

Segmentation fault
vagrant@php7dev:~/Development/php-weak-lib$ valgrind php vendor/bin/phpunit --coverage-text --configuration phpunit.xml
==9472== Memcheck, a memory error detector
==9472== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==9472== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==9472== Command: php vendor/bin/phpunit --coverage-text --configuration phpunit.xml
==9472==
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.

==9472== Invalid read of size 1
==9472== at 0xF8C6B9D: xdebug_set_in_ex (xdebug_set.c:72)
==9472== by 0xF8AFE7E: xdebug_analyse_branch (xdebug_code_coverage.c:681)
==9472== by 0xF8AFFB9: xdebug_analyse_branch (xdebug_code_coverage.c:713)
==9472== by 0xF8B01E5: xdebug_analyse_oparray (xdebug_code_coverage.c:768)
==9472== by 0xF8B0547: prefill_from_oparray (xdebug_code_coverage.c:848)
==9472== by 0xF8B0733: prefill_from_function_table (xdebug_code_coverage.c:890)
==9472== by 0xF8B0810: prefill_from_class_table (xdebug_code_coverage.c:918)
==9472== by 0xB0DE7B: zend_hash_apply_with_arguments (zend_hash.c:1580)
==9472== by 0xF8B0962: xdebug_prefill_code_coverage (xdebug_code_coverage.c:937)
==9472== by 0xF8B0992: xdebug_code_coverage_start_of_function (xdebug_code_coverage.c:944)
==9472== by 0xF8A9999: xdebug_execute_ex (xdebug.c:1843)
==9472== by 0xADB6CC: zend_call_function (zend_execute_API.c:860)
==9472== Address 0x107c1a04 is 4 bytes inside an unallocated block of size 255,456 in arena "client"
==9472==
==9472== Invalid read of size 1
==9472== at 0xF8C6AFC: xdebug_set_add (xdebug_set.c:50)
==9472== by 0xF8AFE97: xdebug_analyse_branch (xdebug_code_coverage.c:687)
==9472== by 0xF8AFFB9: xdebug_analyse_branch (xdebug_code_coverage.c:713)
==9472== by 0xF8B01E5: xdebug_analyse_oparray (xdebug_code_coverage.c:768)
==9472== by 0xF8B0547: prefill_from_oparray (xdebug_code_coverage.c:848)
==9472== by 0xF8B0733: prefill_from_function_table (xdebug_code_coverage.c:890)
==9472== by 0xF8B0810: prefill_from_class_table (xdebug_code_coverage.c:918)
==9472== by 0xB0DE7B: zend_hash_apply_with_arguments (zend_hash.c:1580)
==9472== by 0xF8B0962: xdebug_prefill_code_coverage (xdebug_code_coverage.c:937)
==9472== by 0xF8B0992: xdebug_code_coverage_start_of_function (xdebug_code_coverage.c:944)
==9472== by 0xF8A9999: xdebug_execute_ex (xdebug.c:1843)
==9472== by 0xADB6CC: zend_call_function (zend_execute_API.c:860)
==9472== Address 0x107c1a04 is 4 bytes inside an unallocated block of size 255,456 in arena "client"
==9472==
==9472== Invalid write of size 1
==9472== at 0xF8C6B17: xdebug_set_add (xdebug_set.c:50)
==9472== by 0xF8AFE97: xdebug_analyse_branch (xdebug_code_coverage.c:687)
==9472== by 0xF8AFFB9: xdebug_analyse_branch (xdebug_code_coverage.c:713)
==9472== by 0xF8B01E5: xdebug_analyse_oparray (xdebug_code_coverage.c:768)
==9472== by 0xF8B0547: prefill_from_oparray (xdebug_code_coverage.c:848)
==9472== by 0xF8B0733: prefill_from_function_table (xdebug_code_coverage.c:890)
==9472== by 0xF8B0810: prefill_from_class_table (xdebug_code_coverage.c:918)
==9472== by 0xB0DE7B: zend_hash_apply_with_arguments (zend_hash.c:1580)
==9472== by 0xF8B0962: xdebug_prefill_code_coverage (xdebug_code_coverage.c:937)
==9472== by 0xF8B0992: xdebug_code_coverage_start_of_function (xdebug_code_coverage.c:944)
==9472== by 0xF8A9999: xdebug_execute_ex (xdebug.c:1843)
==9472== by 0xADB6CC: zend_call_function (zend_execute_API.c:860)
==9472== Address 0x107c1a04 is 4 bytes inside an unallocated block of size 255,456 in arena "client"
==9472==
EEEE
Fatal error: Uncaught Exception: Prevent weakref handler to be executed in /home/vagrant/Development/php-weak-lib/tests/SplObjectStorageTest.php on line 105

Exception: Prevent weakref handler to be executed in /home/vagrant/Development/php-weak-lib/tests/SplObjectStorageTest.php on line 105

Call Stack:
0.4698 371864 1. {main}() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/phpunit:0
1.7726 766632 2. PHPUnit_TextUI_Command::main() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/phpunit:47
1.7883 769960 3. PHPUnit_TextUI_Command->run() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/Command.php:106
5.8001 2788408 4. PHPUnit_TextUI_TestRunner->doRun() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/Command.php:155
6.3190 3214104 5. PHPUnit_Framework_TestSuite->run() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:429
11.3115 4526704 6. PHPUnit_Framework_TestSuite->run() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
14.0603 4665552 7. PHPUnit_Framework_TestCase->run() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
14.0620 4665552 8. PHPUnit_Framework_TestResult->run() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestCase.php:726
14.2284 4698608 9. {anonymous-class:/home/vagrant/Development/php-weak-lib/tests/SplObjectStorageTest.php:101-107}->__destruct() /home/vagrant/Development/php-weak-lib/vendor/phpunit/phpunit/src/Framework/TestResult.php:702

==9472==
==9472== HEAP SUMMARY:
==9472== in use at exit: 5,571 bytes in 56 blocks
==9472== total heap usage: 204,570 allocs, 204,514 frees, 12,646,884 bytes allocated
==9472==
==9472== LEAK SUMMARY:
==9472== definitely lost: 312 bytes in 13 blocks
==9472== indirectly lost: 0 bytes in 0 blocks
==9472== possibly lost: 0 bytes in 0 blocks
==9472== still reachable: 5,259 bytes in 43 blocks
==9472== suppressed: 0 bytes in 0 blocks
==9472== Rerun with --leak-check=full to see details of leaked memory
==9472==
==9472== For counts of detected and suppressed errors, rerun with: -v
==9472== ERROR SUMMARY: 52 errors from 3 contexts (suppressed: 0 from 0)

derick

2016-01-12 10:08

administrator   ~0003411

I have a fix for the crash, but I am not quite there with it making the test pass.

zaq178miami

2016-01-12 15:18

reporter   ~0003416

See it in your fork. Thank you for investigating the issue.

derick

2016-01-19 22:25

administrator   ~0003423

Fixed in GitHub's master branch.

Issue History

Date Modified Username Field Change
2015-12-20 20:25 derick New Issue
2016-01-12 09:05 derick Note Added: 0003406
2016-01-12 09:05 derick Note Added: 0003407
2016-01-12 09:06 derick Note Added: 0003408
2016-01-12 09:06 derick Note Added: 0003409
2016-01-12 10:08 derick Note Added: 0003411
2016-01-12 15:18 zaq178miami Note Added: 0003416
2016-01-19 22:25 derick Note Added: 0003423
2016-01-19 22:25 derick Status new => closed
2016-01-19 22:25 derick Assigned To => derick
2016-01-19 22:25 derick Resolution open => fixed
2016-01-19 22:25 derick Fixed in Version => 2.4.0
2016-01-25 21:59 derick Fixed in Version 2.4.0 => 2.4.0rc4
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized