[gps-devel] gnat-gps 2.1.0-3 (debian) crashes the whole X-Windows system

Ludovic Brenta ludovic.brenta at insalien.org
Wed Apr 27 20:13:06 CEST 2005


Hail the beauty of free software and worldwide cooperation.  Jan
Nordholz provided some valuable insight into Debian bug #297980, which
allowed me to correct it.  Due to a bug in gvd/gnat/gexpect_tty.c, GPS
calls kill (-1, SIGINT) which causes the user's session and the X
server to shut down.  As it turns out, I am no longer certain that
this bug was specific to Debian; it may exist on other platforms as
well.  This is difficult to tell because gexpect_tty.c is a horrible
mess of #ifdefs.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297980
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=297985

The minimalistic patch below corrects this behaviour.  I looked at the
CVS repository and noticed that the file gexpect_tty.c has moved from
gvd/gnat to common/gnat, but the patch can still be applied.

Note that, as Jan puts it, this patch mends the symptoms but not the
root cause of the problem, which is the call to ioctl() on a closed
file descriptor.  More details are in the bug reports [1,2].

gnat-gps 2.1.0-4 will be in Debian in the next few days, with this
patch.

-- 
Ludovic Brenta.

--- gvd/gnat/gexpect_tty.c~	2003-10-15 10:33:51.000000000 +0200
+++ gvd/gnat/gexpect_tty.c	2005-04-27 08:25:51.000000000 +0200
@@ -1708,10 +1708,8 @@
 	else
 	  err = ioctl (XINT (p->infd), TIOCGPGRP, &gid);
 
-#ifdef pfa
 	if (err == -1)
 	  gid = - XFASTINT (p->pid);
-#endif /* ! defined (pfa) */
       }
       if (gid == -1)
 	no_pgrp = 1;




More information about the gps-devel mailing list