Re: Re: [SQL] PostgreSQL crashes on me :( - Mailing list pgsql-hackers

From ncm@zembu.com (Nathan Myers)
Subject Re: Re: [SQL] PostgreSQL crashes on me :(
Date
Msg-id 20001217230141.A28714@store.zembu.com
Whole thread Raw
In response to Re: [SQL] PostgreSQL crashes on me :(  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: [SQL] PostgreSQL crashes on me :(
List pgsql-hackers
On Sun, Dec 17, 2000 at 10:47:55PM -0500, Tom Lane wrote:
> 
> A quick-and-dirty workaround would be to save and restore errno in
> reaper() and the other postmaster signal handlers.  It might be
> a better idea in the long run to avoid doing system calls in the
> signal handlers --- but that would take a more substantial rewrite.
> 
> I seem to recall previous pghackers discussions in which
> saving/restoring errno looked like a good idea.  Not sure why
> it hasn't been done already.

Syscalls in signal handlers open doors for lots of mischief, not least 
because it's impractical to test all the combinations of half-run mainline
syscalls with all the other syscalls that may occur in signal handlers.  
(select() and wait(), by themselves, get exercised enough, but bugs in
other pairs may be too hard to reproduce ever to be identified.)  Maybe 
somebody noted that patching errno handling would only close one hole, 
and make it less likely the real fix would be done.

That the signal handler got an error on its syscall might be cause for 
concern as well.  

Sounds like a TODO list item: eliminate syscalls from signal handlers.

Nathan Myers
ncm@zembu.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Who is a maintainer of GiST code ?
Next
From: Karel Zak
Date:
Subject: Re: Trigger