vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] xvile 9.7y core dumps on *.rc files


From: Thomas Dickey
Subject: Re: [vile] xvile 9.7y core dumps on *.rc files
Date: Thu, 31 Dec 2009 08:42:17 -0500 (EST)

On Thu, 31 Dec 2009, Gary Jennejohn wrote:

On Thu, 31 Dec 2009 06:25:48 -0500 (EST)
Thomas Dickey <address@hidden> wrote:

On Thu, 31 Dec 2009, Gary Jennejohn wrote:

I just tried to look at /usr/local/share/vile/vileinit.rc with xvile
and got a core dump.  I've only seen this with *.rc files so far.
C, shell scripts and mail are OK.

If I comment out "set cs light" in my .vilerc then it works.

However, vile works just fine with "set cs light".

Is there a way to test whether vile or xvile is running so I can "set
cs light" only for vile?  xvile actually works OK without that setting.

Here a bt from gdb:
(gdb) bt
#0  0x000000080161f41c in kill () from /lib/libc.so.7
#1  0x000000080161e21b in abort () from /lib/libc.so.7
#2  0x000000000044942b in imdying ()
#3  <signal handler called>
#4  0x000000000041eb83 in get_color_gc ()

I don't see the cause, but it could be an out-of-bounds index into the
color-arrays.  This would help in that case:

diff -u -r1.354 x11.c
--- x11.c       2009/12/09 01:47:36     1.354
+++ x11.c       2009/12/31 11:22:21
@@ -2,7 +2,7 @@
   *     X11 support, Dave Lemke, 11/91
   *     X Toolkit support, Kevin Buettner, 2/94
   *
- * $Header: /usr/build/vile/vile/RCS/x11.c,v 1.354 2009/12/09 01:47:36 tom Exp$
+ * $Header: /usr/build/vile/vile/RCS/x11.c,v 1.356 2009/12/31 11:22:21 tom Exp$
   *
   */

@@ -2180,10 +2180,15 @@
  static GC
  get_color_gc(int n, Boolean normal)
  {
-    ColorGC *data = (normal
-                    ? &(cur_win->fore_color[n])
-                    : &(cur_win->back_color[n]));
+    ColorGC *data;

+    assert(n >= 0 && n < NCOLORS);
+
+    if (n < 0 || n > NCOLORS)
+       n = 0;                  /* shouldn't happen */
+    data = (normal
+           ? &(cur_win->fore_color[n])
+           : &(cur_win->back_color[n]));
      if (cur_win->screen_depth == 1) {
         data->gc = (normal
                     ? cur_win->textgc


Yup, this patch fixes it.

thanks. I put in the assert so that I might stumble over the actual cause when I'm debugging. (The assert's are turned on when tracing is compiled-in).

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]