segfaults when running graphical reports

Thomas Klausner tk at
Mon Apr 21 17:38:47 EDT 2014

On Sun, Apr 13, 2014 at 09:35:11AM +0200, Thomas Klausner wrote:
> The first: If I start gnucash without a terminal or in the background,
> it doesn't finish startup. When started in the background, I see (with
> zsh):
> > gnucash &
> [1] 7303
> > 
> [1]  + suspended (tty output)  gnucash
> When I put it in the foreground again, it continues starting
> successfully. This seems to happen during the splash screen, the last
> thing that's displayed in the progress text at the bottom is
> "gnucash/python". Perhaps this is a problem with a python module, but
> how do I find out which?

I contacted the readline upstream about it, and while they didn't find
anything they saw as changed on their side (i.e., readline behaviour
has always been this way), they pointed me in the direction of a
simple fix: just ignoring the SIGTTOU signal.

Using the attached patch makes gnucash start in the background again.

Even if for some reason noone else has had this problem yet, I hope
it's uncontroversial enough to be accepted?
-------------- next part --------------

Allow starting gnucash in the background.
python's readline module causes a SIGTTOU to be sent and if this
is not handled (even by ignoring it), it stops the process.

--- src/bin/gnucash-bin.c.orig	2014-03-01 19:55:35.000000000 +0000
+++ src/bin/gnucash-bin.c
@@ -22,6 +22,7 @@
 #include "config.h"
+#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -566,6 +567,8 @@ inner_main (void *closure, int argc, cha
     char* fn;
     GError *error = NULL;
+    signal(SIGTTOU, SIG_IGN);
     scm_c_eval_string("(debug-set! stack 200000)");
     main_mod = scm_c_resolve_module("gnucash main");

More information about the gnucash-devel mailing list