Insight problem when environment variable DISPLAY=xxx.xxx.xxx.xxx:0.

Nunzio Raciti <[email protected]>
Newsgroups gmane.comp.debugging.insight
Message-ID <[email protected]>
Hi All,

I discovered a bug on Insight, probably exposed by new version of libc,
when the environment variable "DISPLAY" is set with a value like
"xxx.xxx.xxx.xxx:0."

The problem occurs exiting from the GUI without open other windows:
1- $ insight
2- check that there aren't other open windows (eg. console, stack....)
3- exit from the GUI (eg. file->exit)
4- if you are using glibc => 2.3.4

*** glibc detected *** double free or corruption (!prev): 0xXXXXXXX ***
Aborted

Attached is my proposal of patch.

Ciao,
Nunzio
insight_var_DISPLAY.patch (text/x-diff, 641 B)
diff U3 C:/Temp/insight-weekly-CVS-7.0.50-20091130/src/tk/generic/tkWindow.c C:/Temp/insight-patched/src/tk/generic/tkWindow.c
--- C:/Temp/insight-weekly-CVS-7.0.50-20091130/src/tk/generic/tkWindow.c	Tue Jan 21 22:24:46 2003
+++ C:/Temp/insight-patched/src/tk/generic/tkWindow.c	Wed May 25 09:44:50 2011
@@ -450,6 +450,11 @@
     if ((*p == '.') && (p[1] != '\0')) {
 	length = p - screenName;
 	screenId = strtoul(p+1, (char **) NULL, 10);
+    } else
+          /* Cover the "xxx.xxx.xxx.xxx:0." case */
+          if ((*p == '.') && (p[1] == '\0')) {
+	      length = p - screenName;
+	      screenId = 0;
     }
 
     /*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.