• Victor Stinner's avatar
    bpo-37851: faulthandler allocates its stack on demand (GH-15358) · d8c5adf6
    Victor Stinner authored
    The faulthandler module no longer allocates its alternative stack at
    Python startup. Now the stack is only allocated at the first
    faulthandler usage.
    
    faulthandler no longer ignores memory allocation failure when
    allocating the stack. sigaltstack() failure now raises an OSError
    exception, rather than being ignored.
    
    The alternative stack is no longer used if sigaction() is
    not available. In practice, sigaltstack() should only be available
    when sigaction() is avaialble, so this change should have no effect
    in practice.
    
    faulthandler.dump_traceback_later() internal locks are now only
    allocated at the first dump_traceback_later() call, rather than
    always being allocated at Python startup.
    d8c5adf6
faulthandler.c 39.9 KB