[Rpm-maint] RFC: Unblocking of signals within rpm

Tomas Mraz tmraz at redhat.com
Thu Jul 19 10:47:52 UTC 2007


On Thu, 2007-07-19 at 13:30 +0300, Panu Matilainen wrote:
> On Thu, 19 Jul 2007, Michael Schroeder wrote:
> 
> > On Thu, Jul 19, 2007 at 12:58:29PM +0300, Panu Matilainen wrote:
> >>
> >> Attached patch turns the signal handling within rpmdb upside down: we no
> >> longer run the whole damn thing with termination signals blocked with
> >> occasional checking possibly resulting in exit() from deep within rpmlib,
> >> but instead have an active signal handler that will mop up any open
> >> transactions and iterators and pass on the signal to caller.
> >
> > Whoa, doing complex things in a signal handler is very dangerous.
> > You can interrupt rpm deep inside some glibc function like "malloc".
> 
> Yes, but then this is a terminating signal handler, and AFAICT does just 
> what's described in glibc manual as the cleanest way to handle this:
> http://www.gnu.org/software/libc/manual/html_node/Termination-in-Handler.html
But you should not in the signal handler for example call any function
which manipulates the heap (calling free() for example).

-- 
Tomas Mraz
No matter how far down the wrong road you've gone, turn back.
                                              Turkish proverb




More information about the Rpm-maint mailing list