[Rpm-maint] RFC: Unblocking of signals within rpm
Panu Matilainen
pmatilai at redhat.com
Thu Jul 19 10:41:44 UTC 2007
On Thu, 19 Jul 2007, 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 yeah, additional signal protection is needed for at least these,
missing from the patch:
- rpmdbInitIterator()
- rpmdbFreeIterator()
- openDatabase()
- rpmdbClose()
- Panu -
More information about the Rpm-maint
mailing list