[sane-devel] signal handling by libsane and backends

Ryan Reading ryanr_23 at hotmail.com
Tue Sep 12 02:02:25 UTC 2006


The sane library and/or its backends don't seem to "clean up" after themselves by restoring signal handlers and/or signal masks.  This isn't a problem for a simple application that only serves as a front end for libsane, but does cause problems in a modular application where libsane may not always be loaded.  For instance, if I wrap libsane and access it indirectly through some component technology, when the component that uses libsane is unloaded, the signal handlers installed by libsane and its backends will still be installed.  Of course, the library is no longer loaded in the process memory space so the function pointers used for the signal handlers are no longer valid.  If a signal for that signal handler is then received, it causes a SIGSEGV.  This can easily happen if you use a sane backend that sets a SIGCHLD signal handler, unload the component consuming libsane, and then use system(3) to launch a shell command.Is this a problem or is there something I'm missing here?  Does anyone have any advice on the "correct" way to work around this problem?  Thanks!-- Ryan
_________________________________________________________________
Use Messenger to talk to your IM friends, even those on Yahoo!
http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20060911/5bfc879d/attachment.html


More information about the sane-devel mailing list