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

Signals and exec() interaction #12352

Open
p5pRT opened this issue Aug 25, 2012 · 3 comments
Open

Signals and exec() interaction #12352

p5pRT opened this issue Aug 25, 2012 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 25, 2012

Migrated from rt.perl.org#114586 (status was 'open')

Searchable as RT114586$

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2012

From @dgl

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

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 2012

From @Leont

On Sat, Aug 25, 2012 at 1​:17 PM, David Leadbeater
<perlbug-followup@​perl.org> wrote​:

# 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-archive.perl.org/perl5/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\)&#8203;:
         \* | 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.

But is that really different from the unsafe version? I'd expect it
not to be, though I don't think POSIX is explicit about this case.

Leon

@p5pRT
Copy link
Author

p5pRT commented Aug 27, 2012

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants