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

Safe 2.35 localizing %SIG

Thread Next
From:
David Cantrell
Date:
May 21, 2013 23:15
Subject:
Safe 2.35 localizing %SIG
Message ID:
20130521231521.GA7801@bytemark.barnyard.co.uk
I've been bitten by the localizing of %SIG in the latest Safe.pm.  I'm
using a SIG ALRM to have execution of the Safe compartment time out:
  https://metacpan.org/source/DCANTRELL/CPAN-ParseDistribution-1.4/lib/CPAN/ParseDistribution.pm#L186

and this no longer works.  I can see why locally undefing %SIG is probably a
good idea, but it would be Really Good if there was a way of controlling
this so that I could specify that I want to be able to handle particular
signals.

Other things: the documentation still warns about the risks of signals,
without making clear what's going to happen; localizing $SIG and @SIG as
well as %SIG is probably not what was intended; and finally, can anyone
think of a clean, simple alternative that I can use for timing out a Safe
compartment?

-- 
David Cantrell | Pope | First Church of the Symmetrical Internet

Eye have a spelling chequer / It came with my pea sea
It planely marques four my revue / Miss Steaks eye kin knot sea.
Eye strike a quay and type a word / And weight for it to say
Weather eye am wrong oar write / It shows me strait a weigh.

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