[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vile] xvile 9.7y core dumps on *.rc files
From: |
Gary Jennejohn |
Subject: |
Re: [vile] xvile 9.7y core dumps on *.rc files |
Date: |
Thu, 31 Dec 2009 14:39:52 +0100 |
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.
---
Gary Jennejohn