Re: plperl sigfpe reset can crash the server

Andres Freund <andres@2ndquadrant.com>

From: Andres Freund <andres@2ndquadrant.com>
To: pgsql-hackers@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, Hannu Krosing <hannu@2ndquadrant.com>
Date: 2012-08-24T22:10:43Z
Lists: pgsql-hackers
On Friday, August 24, 2012 04:53:36 PM Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > ./pod/perl581delta.pod:
> > At startup Perl blocks the SIGFPE signal away since there isn't much
> > Perl can do about it.  Previously this blocking was in effect also for
> > programs executed from within Perl.  Now Perl restores the original
> > SIGFPE handling routine, whatever it was, before running external
> > programs.
> 
> So there's a gap in the "restore" logic someplace.
> 
> > perl.h also has some tidbits: ...
> > That doesn't sound very well reasoned and especially not very well tested
> > to me.
> 
> Time to file a Perl bug?
We probably should workaround that bug anyway given that its a pretty trivial 
DOS using only a trusted language and it will take quite some time to push out 
newer perl versions even if that bug gets fixed.

Doing a pqsignal(SIGFPE, FloatExceptionHandler) after PERL_SYS_INIT3 seems to 
work. Is that acceptable?

Andres
-- 
Andres Freund		http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services