develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #114586] Signals and exec() interaction

Thread Next
From:
David Leadbeater
Date:
August 25, 2012 04:17
Subject:
[perl #114586] Signals and exec() interaction
Message ID:
rt-3.6.HEAD-11172-1345893449-1136.114586-75-0@perl.org
# New Ticket Created by  David Leadbeater 
# Please include the string:  [perl #114586]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114586 >


In despatch_signals in mg.c there's a comment explaining how perl
tries to emulate a behaviour of real signals in safe signals:

            /* From sigaction(2) (FreeBSD man page):
             * | Signal routines normally execute with the signal that
             * | caused their invocation blocked, but other signals may
             * | yet occur.
             * Emulation of this behavior (from within Perl) is enabled
             * using sigprocmask
             */

However there's an issue in the emulation: if a signal handler
directly calls exec() the signal is never unblocked, because the
destructor/clean up function set up in Perl_despatch_signals isn't
called.

David


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About