Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[phpdbg] Segfault with phpunit and codecoverage #13707

Closed
lyrixx opened this issue Mar 14, 2024 · 4 comments
Closed

[phpdbg] Segfault with phpunit and codecoverage #13707

lyrixx opened this issue Mar 14, 2024 · 4 comments

Comments

@lyrixx
Copy link

lyrixx commented Mar 14, 2024

Description

I created a very minimal reproducer there

PHP Version

PHP 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Feb 15 2024 18:38:52) (NTS)

Operating System

Ubuntu 22.04.4 LTS

lyrixx added a commit to lyrixx/test that referenced this issue Mar 14, 2024
nicolas-grekas added a commit to symfony/symfony that referenced this issue Mar 14, 2024
This PR was merged into the 7.1 branch.

Discussion
----------

[PhpUnitBridge] Enhance CoverageListenerTests

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

The test were broken on my laptop, so I dig it a bit and:

* Add support support for pvoc
* Change priority of driver, it's now xdebug > pcov > phpdbg (reflects
  more real usages)
* Update deprecated phpunit.xml.dist configuration
* Ensure the $output buffer is empty before running sub-tests
* open php bug report because phpdbg segfault, see php/php-src#13707

Commits
-------

4f49fd3 [PhpUnitBridge] Enhance CoverageListenerTests
@nielsdos
Copy link
Member

I can't reproduce this. Try without loading php extensions and please share your phpinfo.
If possible, try compiling php with ASAN support.

@lyrixx
Copy link
Author

lyrixx commented Mar 15, 2024

I found the culprit

>/home/gregoire/dev/github.com/lyrixx/test(php/php-src/issues/13707 %) phpdbg -nqrrv -d extension=dom -d extension=mbstring -d extension=tokenizer -d extension=xml -d extension=xmlwriter -d extension=pcov vendor/bin/phpunit   --coverage-text
PHPUnit 9.6.17 by Sebastian Bergmann and contributors.

Segmentation fault (core dumped)
>/home/gregoire/dev/github.com/lyrixx/test```

It fails when I enable pcov

@nielsdos
Copy link
Member

Okay, thanks for investigating.
I would recommend opening a bug report then at the pcov extension repo. This is likely an issue there and not in php(dbg) itself.
If it would turn out that it is a php issue after all, please ping me and I'll reopen this.

@nielsdos nielsdos closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@jtojnar
Copy link

jtojnar commented May 6, 2024

I managed to reproduce it with xdebug too (by running make coverage on contributte/forms-multiplier#101 or running the command from above with pcov substituted for xdebug).

Here is a (not very helpful) stack trace:

(gdb) thread apply all bt

Thread 1 (Thread 0x7ff5ee845980 (LWP 4727)):
#0  0x00007ff5ee04275b in kill () at ../sysdeps/unix/syscall-template.S:120
#1  0x000055b7e015769b in zend_signal_handler (signo=signo@entry=11, siginfo=siginfo@entry=0x7ffcd37434b0, context=context@entry=0x7ffcd3743380) at ./Zend/zend_signal.c:208
#2  0x000055b7e01577a3 in zend_signal_handler_defer (signo=11, siginfo=0x7ffcd37434b0, context=0x7ffcd3743380) at ./Zend/zend_signal.c:105
#3  <signal handler called>
#4  0x000055b7e016b8c2 in zend_observer_fcall_end (execute_data=execute_data@entry=0x7ff5eba18020, return_value=return_value@entry=0x0) at ./Zend/zend_observer.c:220
#5  0x000055b7e016b9b0 in zend_observer_fcall_end_all () at ./Zend/zend_observer.c:240
#6  0x000055b7e006d00c in php_request_shutdown (dummy=dummy@entry=0x0) at ./main/main.c:1809
#7  0x000055b7dff120f2 in main (argc=5, argv=0x7ffcd3744d78) at ./sapi/phpdbg/phpdbg.c:1720

This is on PHP 8.1.28:

php_request_shutdown(NULL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants