Re: [HACKERS] plperl sigfpe reset can crash the server

2012-09-05 Thread Andres Freund
On Sunday, August 26, 2012 06:10:02 PM Andres Freund wrote: On Saturday, August 25, 2012 06:38:09 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Doing a pqsignal(SIGFPE, FloatExceptionHandler) after PERL_SYS_INIT3 seems to work. Is that acceptable? Surely that's

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-09-05 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Sunday, August 26, 2012 06:10:02 PM Andres Freund wrote: On Saturday, August 25, 2012 06:38:09 AM Tom Lane wrote: Surely that's breaking perl's expectations, to more or less the same degree they're breaking ours? In the referenced bug they

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-09-05 Thread Andres Freund
On Wednesday, September 05, 2012 07:15:52 PM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Sunday, August 26, 2012 06:10:02 PM Andres Freund wrote: On Saturday, August 25, 2012 06:38:09 AM Tom Lane wrote: Surely that's breaking perl's expectations, to more or less the same

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-09-05 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Wednesday, September 05, 2012 07:15:52 PM Tom Lane wrote: OK. Do we want to commit this now, or wait till after 9.2.0? My feeling is it's probably okay to include in 9.2.0, but I can see that somebody might want to argue not to. Any objections

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-26 Thread Andres Freund
On Saturday, August 25, 2012 06:38:09 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Doing a pqsignal(SIGFPE, FloatExceptionHandler) after PERL_SYS_INIT3 seems to work. Is that acceptable? Surely that's breaking perl's expectations, to more or less the same degree they're

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Tom Lane
Andres Freund and...@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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andres Freund
On Friday, August 24, 2012 04:53:36 PM Tom Lane wrote: Andres Freund and...@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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andrew Dunstan
On 08/24/2012 10:58 AM, Andres Freund wrote: On Friday, August 24, 2012 04:53:36 PM Tom Lane wrote: Andres Freund and...@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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andres Freund
On Friday, August 24, 2012 05:09:18 PM Andrew Dunstan wrote: On 08/24/2012 10:58 AM, Andres Freund wrote: On Friday, August 24, 2012 04:53:36 PM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: ./pod/perl581delta.pod: At startup Perl blocks the SIGFPE signal away since there

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andres Freund
On Friday, August 24, 2012 04:53:36 PM Tom Lane wrote: Andres Freund and...@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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Alex Hunsaker
On Fri, Aug 24, 2012 at 4:10 PM, Andres Freund and...@2ndquadrant.com wrote: 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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andres Freund
On Saturday, August 25, 2012 12:15:00 AM Alex Hunsaker wrote: On Fri, Aug 24, 2012 at 4:10 PM, Andres Freund and...@2ndquadrant.com wrote: 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

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Doing a pqsignal(SIGFPE, FloatExceptionHandler) after PERL_SYS_INIT3 seems to work. Is that acceptable? Surely that's breaking perl's expectations, to more or less the same degree they're breaking ours? regards, tom lane --

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-24 Thread Andres Freund
On Saturday, August 25, 2012 06:38:09 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Doing a pqsignal(SIGFPE, FloatExceptionHandler) after PERL_SYS_INIT3 seems to work. Is that acceptable? Surely that's breaking perl's expectations, to more or less the same degree they're

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: Hi, While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: andres@awork2:~$ psql -p 5435 -U postgres -h /var/run/postgresql test Timing is on. psql (9.1devel,

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In fact it can be used to crash the server: Um ... how exactly

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu always removes the SIGFPE handler and sets it to ignore: In

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 07:19:42 AM Andres Freund wrote: On Friday, August 24, 2012 06:55:04 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Thursday, August 23, 2012 12:17:22 PM Andres Freund wrote: While debugging an instance of this bug I noticed that plperlu

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: Um ... how exactly can that happen, if the signal is now ignored? My man 2 signal tells me: According to POSIX, the behavior of a process is undefined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(2) or

Re: [HACKERS] plperl sigfpe reset can crash the server

2012-08-23 Thread Andres Freund
On Friday, August 24, 2012 07:33:01 AM Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: Um ... how exactly can that happen, if the signal is now ignored? My man 2 signal tells me: According to POSIX, the behavior of a process is undefined after it ignores a SIGFPE, SIGILL,