fix: remove 'SIGINT' signal handler
This signal handler was calling non-trivial functions that performed signal-unsafe work. In particular, attempts to interact with the system allocator. Quoting downstream discussion:¹
On Mon, 4 Mar 2013 21:26:40 -0600, Jeff Epler wrote:
> On Sun, Mar 03, 2013 at 12:20:57PM +0000, Steven Chamberlain wrote:
> > > #5 0x0000000800d21f2c in *__GI___libc_free (mem=<optimized out>) at malloc.c:3736
> > > ar_ptr = 0x800ff3240
> > > p = <optimized out>
> > > #6 0x0000000800844a79 in gvFreeContext () from /usr/lib/libgvc.so.5
> > > No symbol table info available.
> > > #7 0x0000000000400fd8 in ?? ()
> > > No symbol table info available.
> > > #8 0x000000080389bf04 in __pthread_sighandler
>
> As many of you are probably aware, it's not permitted in POSIX to call free()
> in signal handler context without some additional guarantees about what the
> interrupted function may be.
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
> (search for "async-signal-safe")
A side effect of this was the documentation build for an unrelated project segfaulting when calling Doxygen that happened to run Graphviz and trigger this problem.
This change removes the signal handler as suggested by some of the Debian discussion:
On Mon, 4 Mar 2013 21:26:40 -0600, Jeff Epler wrote:
> whatever gvRenderJobs is intended to do is likely hard
> to guarantee to be only doing async-signal-safe things (let alone things that
> are data-structure safe). Indeed, I got a sigsegv when sending SIGINT exactly
> when the first free inside gvLayoutJobs is holding the lock
On Tue, 05 Mar 2013 11:39:02 +0000, Steven Chamberlain wrote:
> The SIGINT handler sounds buggy, and maybe not that useful (who needs a
> half-rendered diagram?) and so it might be best to disable it, which
> would fix http://bugs.debian.org/524408
Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524408
Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701832
¹ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701832#80