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

csighandler3: try a fallback interpreter if none in TLS #22530

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Commits on Aug 21, 2024

  1. csighandler3: try a fallback interpreter if none in TLS

    If an external library, possibly loaded by an XS module, creates a
    thread, perl has no control over this thread, nor does it create an
    interpreter for that thread, so if a signal is delivered to that
    thread my_perl would be NULL, and we would crash trying to safely
    deliver the signal.
    
    To avoid that uses the saved main interpreter pointer instead.
    
    Since trying to unsafe deliver the signal to the handler from the
    wrong thread would result in races on the interpreter's data
    structures I chose not to direct deliver unsafe signals.
    
    Accessing PL_psig_pend[] from the wrong thread isn't great, but to
    ensure safe handling of that we'd need lockless atomics, which we
    don't have access to from C99 (and aren't required in C11).
    
    Fixes Perl#22487
    tonycoz committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    e3b96ee View commit details
    Browse the repository at this point in the history