Skip to content

zend_signal_handler_defer() called in a thread not managed by PHP on ARM64 ZTS build #9809

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

Closed
Girgias opened this issue Oct 22, 2022 · 6 comments

Comments

@Girgias
Copy link
Member

Girgias commented Oct 22, 2022

Description

One of the Travis builds failed for an unrelated PR after #9766 got merged.

014+ zend_signal_handler_defer() called in a thread not managed by PHP. The expected signal handler will not be called. This is probably a bug.

For file FAIL $http_reponse_header (redirect) [ext/standard/tests/http/http_response_header_02.phpt]

@dunglas any idea what the issue may be?

PHP Version

PHP 8.3.0-dev

Operating System

No response

@bukka
Copy link
Member

bukka commented Oct 22, 2022

I see those too in https://app.travis-ci.com/github/php/php-src/jobs/586399691 . From a quick look it seems to me like it might be due to the way the http server is killed in http_server_kill:

posix_kill($pid, SIGTERM);
pcntl_waitpid($pid, $status);

Not sure really why though so this might need some further investigation.

@dunglas
Copy link
Member

dunglas commented Oct 22, 2022

I'll try to take a look tomorrow or on Monday. Basically the change prevents the signal handlers to be executed on threads where TSRM hasn't been started (that was causing segmentation faults). We're probably in this case here.

@iluuu1994
Copy link
Member

/cc @arnaud-lb

@arnaud-lb
Copy link
Member

This could happen if the signal is delivered after tsrm_shutdown(). We should move the tsrm_is_managed_thread() check after the tsrm_is_shutdown() one.

@bukka
Copy link
Member

bukka commented Oct 23, 2022

Yeah agreed, the tsrm_is_managed_thread() should not be called after shutdown. The swap committed in 365178a

@iluuu1994
Copy link
Member

CI looks good now, so I'm assuming this is properly fixed. Thank you!

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

6 participants