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

Re: [perl #93428] potential race condition when mixing signals andselect()

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 1, 2012 03:00
Subject:
Re: [perl #93428] potential race condition when mixing signals andselect()
Message ID:
20120601100044.GF9069@plum.flirble.org
On Sun, May 27, 2012 at 03:34:02PM -0700, Leon Timmermans via RT wrote:
> 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. 

Nice trick. Who is writing the demo code? :-)

Nicholas Clark

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