Skip to content

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

Closed

Description

@Girgias

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

Activity

  1. bukka commented on Oct 22, 2022

    @bukka
    Member

    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.

  2. dunglas commented on Oct 22, 2022

    @dunglas
    Member

    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.

  3. iluuu1994 commented on Oct 22, 2022

    @iluuu1994
    Member
  4. arnaud-lb commented on Oct 23, 2022

    @arnaud-lb
    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.

  5. bukka commented on Oct 23, 2022

    @bukka
    Member

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

  6. iluuu1994 commented on Oct 24, 2022

    @iluuu1994
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions