|
|
Failing build sets minimum-stability to dev and installs a lot of branches.
I identified that segmentation fault happens since this commit in symfony/console library https://github.com/symfony/console/commit/5b066d629a77b03ba804f4030a0f13f83665886b |
|
|
|
Hi,
thanks for the small reproducible case, but when I run it, i get a PHP error:
$ XDEBUG_MODE=coverage ./codecept run tests/unit/Codeception/StepTest.php -o 'coverage: path_coverage: true' --coverage
Codeception PHP Testing Framework v5.0.0 https://helpukrainewin.org
[Seed] 1249552899
Fatal error: Declaration of Codeception\PHPUnit\Wrapper\Test::run(PHPUnit\Framework\TestResult $result): void must be compatible with PHPUnit\Framework\Test::run(): void in /tmp/2108/Codeception/src/PHPUnit/Wrapper/PhpUnit10/Test.php on line 10
And I don't see what I need to update to fix this.
cheers,
Derick |
|
|
|
OK. I have made this change:
diff --git src/PHPUnit/Wrapper/PhpUnit10/Test.php src/PHPUnit/Wrapper/PhpUnit10/Test.php
index 4ee087c64..b76916f7f 100644
--- src/PHPUnit/Wrapper/PhpUnit10/Test.php
+++ src/PHPUnit/Wrapper/PhpUnit10/Test.php
@@ -7,7 +7,7 @@
abstract class Test implements PHPUnitTest
{
- public function run(TestResult $result): void
+ public function run(): void
{
// does nothing
}
And when running with USE_ZEND_ALLOC=0, I am getting the following valgrind warnings, which can easily turn into actual crashes:
$ XDEBUG_MODE=coverage valgrind php ./codecept run tests/unit/Codeception/StepTest.php -o 'coverage: path_coverage: true' --coverage
==1074664== Memcheck, a memory error detector
==1074664== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1074664== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1074664== Command: php ./codecept run tests/unit/Codeception/StepTest.php -o coverage:\ path_coverage:\ true --coverage
==1074664==
Codeception PHP Testing Framework v5.0.0 https://helpukrainewin.org
[Seed] 1642368277
Unit Tests (11) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- StepTest: No args==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x929A42B: xdebug_branch_info_mark_reached (branch_info.c:376)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664==
==1074664== Use of uninitialised value of size 8
==1074664== at 0x929A51A: xdebug_branch_info_mark_reached (branch_info.c:379)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x8CBA10: ap_php_conv_10 (snprintf.c:232)
==1074664== by 0x8CCA61: format_converter (snprintf.c:745)
==1074664== by 0x8CDAB2: strx_printv (snprintf.c:1092)
==1074664== by 0x8CDD0F: ap_php_vsnprintf (snprintf.c:1141)
==1074664== by 0x928ACCD: xdebug_sprintf (str.c:222)
==1074664== by 0x929A56F: xdebug_branch_info_mark_reached (branch_info.c:386)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x8CBA8C: ap_php_conv_10 (snprintf.c:249)
==1074664== by 0x8CCA61: format_converter (snprintf.c:745)
==1074664== by 0x8CDAB2: strx_printv (snprintf.c:1092)
==1074664== by 0x8CDD0F: ap_php_vsnprintf (snprintf.c:1141)
==1074664== by 0x928ACCD: xdebug_sprintf (str.c:222)
==1074664== by 0x929A56F: xdebug_branch_info_mark_reached (branch_info.c:386)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x8CCAB9: format_converter (snprintf.c:750)
==1074664== by 0x8CDAB2: strx_printv (snprintf.c:1092)
==1074664== by 0x8CDD0F: ap_php_vsnprintf (snprintf.c:1141)
==1074664== by 0x928ACCD: xdebug_sprintf (str.c:222)
==1074664== by 0x929A56F: xdebug_branch_info_mark_reached (branch_info.c:386)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x4845818: strlen (vg_replace_strmem.c:494)
==1074664== by 0x929A57F: xdebug_branch_info_mark_reached (branch_info.c:388)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Use of uninitialised value of size 8
==1074664== at 0x9284400: xdebug_hash_extended_find (hash.c:215)
==1074664== by 0x929A5A9: xdebug_branch_info_mark_reached (branch_info.c:388)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x4845818: strlen (vg_replace_strmem.c:494)
==1074664== by 0x929A5F3: xdebug_branch_info_mark_reached (branch_info.c:390)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Use of uninitialised value of size 8
==1074664== at 0x92840F6: xdebug_hash_add_or_update (hash.c:160)
==1074664== by 0x929A61A: xdebug_branch_info_mark_reached (branch_info.c:390)
==1074664== by 0x929B1C5: xdebug_print_opcode_info (code_coverage.c:171)
==1074664== by 0x929B4BA: xdebug_common_override_handler (code_coverage.c:239)
==1074664== by 0x9A6F7E: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3134)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A2262: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1728)
==1074664==
==1074664== Conditional jump or move depends on uninitialised value(s)
==1074664== at 0x929D7C9: xdebug_coverage_count_line_if_active (code_coverage.c:933)
==1074664== by 0x929D833: xdebug_coverage_count_line_if_branch_check_active (code_coverage.c:941)
==1074664== by 0x927DE0A: xdebug_add_stack_frame (base.c:704)
==1074664== by 0x927E6B6: xdebug_execute_internal (base.c:921)
==1074664== by 0x9A27CD: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1872)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A26A6: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1837)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664== by 0x9A26A6: ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:1837)
==1074664== by 0x9A703B: ZEND_USER_OPCODE_SPEC_HANDLER (zend_vm_execute.h:3153)
==1074664== by 0xA143A1: execute_ex (zend_vm_execute.h:55868)
==1074664== by 0x927E339: xdebug_execute_ex (base.c:830)
==1074664==
Now to find out why... and how to fix it :-) |
|
|
|
Priority can be changed to low, because segmentation fault no longer happens after https://github.com/symfony/console/commit/8fe565067c4e8786d10e6ba36b161fc10e4c5224 |
|
|
|
symfony/console 6.2.0-BETA3 causes segmentation fault with path coverage again after: https://github.com/symfony/console/commit/01c90dba590bcdc5699597b8090407b4441dfad4 |
|
|
|
I failed to reproduce this segfault without Codeception, here is the smallest reproduction I can make: https://github.com/Naktibalda/codeception-segfault
I noticed that segfault doesn't happen if foreach in linked symfony/console code is removed ($commandSignals is empty, removing code inside loop makes no difference). |
|
|
|
This segmentation fault was released as symfony/console 5.4.16, 6.0.16, 6.1.8 and 6.2.0
It affects Codeception 5 when used with PHPUnit 9.5 too.
Let's wait and see if anyone uses path coverage with Codeception 5. |
|
|
|
https://github.com/Naktibalda/codeception-segfault/actions/runs/3604838128/jobs/6074617926#step:5:13 |
|
|
|
I can reproduce this with your minimal codeception case. Going to see why now though :-) |
|
|
derick
2022-12-05 18:23
administrator
~0006460
Last edited: 2022-12-05 18:39
|
I have made this PR, which address both your initial reproduce case, as well as your minimal one:
https://github.com/xdebug/xdebug/pull/873
Would you be able to test with this branch? It's https://github.com/derickr/xdebug/tree/issue2108-cc-segfault
cheers,
Derick |
|
|
|
Testing Xdebug looks complicated, it would be nice if you had step-by-step instructions how to do it.
Ot looks like compiled xdebug is unlikely to collaborate with installed php on Ubuntu 22.04, am I wrong about it?
I could try to reuse your CircleCI script to build a docker image, but it is time consuming and I have nothing substantially different from what you already tested to test, so most likely I won't test it.
Please merge your pull request if it looks good to you. |
|
|
|
Testing is covered in the README: https://github.com/xdebug/xdebug#testing
But I meant more, compile the Xdebug branch that I pointed to, and then run your tests :-)
In any case, I have merged it (through https://github.com/xdebug/xdebug/pull/873), and it will be part of the 3.2.0 release, that I will be making straight away. |
|
|
|
Thank you, I can confirm that Xdebug 3.2.0 no longer causes this segmentation fault. |
|