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

[perl #93428] potential race condition when mixing signals and select()

Thread Previous | Thread Next
From:
Leon Timmermans via RT
Date:
May 27, 2012 18:54
Subject:
[perl #93428] potential race condition when mixing signals and select()
Message ID:
rt-3.6.HEAD-5009-1338158040-1443.93428-15-0@perl.org
On Fri Jan 13 08:39:09 2012, nicholas wrote:
> Gah, and I suspect it's really hard, if not impossible, to probe for
> that.
> hints files?

To the contrary, it seems quite easy. Set a signal-handler (without the
SA_RESTART flag), block that signal, send it to the process and then do
a pselect unblocking that signal. If it's a real pselect, it will be
interrupted and thus return EINTR. If pselect is faked the signal will
arrive right after the sigprocmask (and thus before the select) so it
won't be interrupted. 

Leon

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=93428

Thread Previous | 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