FVWM: Re: FvwmEvent Core Dumps

From: Dominik Vogt <dominik.vogt_at_gmx.de>
Date: Sun, 13 Jun 1999 05:13:16 +0200

On Fri, Jun 11, 1999 at 07:27:29PM -0400, Thomas A. Gardiner wrote:
> only this time it is not FvwmEvent which core dumps, but FvwmTaskBar. The
> output of running gdb over the core follows.
>
> [tom_at_d185fcdc5 tom]$ gdb
> /home/tom/fvwm2.2.2/libexec/fvwm/2.2.2//FvwmTaskBar
> GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> details.
> This GDB was configured as "i386-redhat-linux"...
> (gdb) core core
> Core was generated by `/home/tom/fvwm2.2.2/libexec/fvwm/2.2.2//FvwmTaskBar
> 9 4 /tmp/fvwmrca28716 0 8'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
> Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
> Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
> Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
> Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
> Reading symbols from /lib/libc.so.6...done.
> Reading symbols from /lib/ld-linux.so.2...done.
> Reading symbols from /lib/libnss_files.so.1...done.
> #0 RemoveButton (array=0x8051048, butnum=3) at ButtonArray.c:351
> 351 temp->next = temp2->next;
> (gdb) where
> #0 RemoveButton (array=0x8051048, butnum=3) at ButtonArray.c:351
> #1 0x804a089 in ProcessMessage (type=128, body=0x8056580) at
> FvwmTaskBar.c:371
> #2 0x8049e23 in ReadFvwmPipe () at FvwmTaskBar.c:309
> #3 0x8049dec in EndLessLoop () at FvwmTaskBar.c:290
> #4 0x8049c8f in main (argc=6, argv=0xbffffbd4) at FvwmTaskBar.c:231
> (gdb)

Try replacing the function RemoveButton in ButtonArray.c (FvwmTaskBar)
with this version (I've checked in a bug fix for 2.3.4, but I think it
works with 2.2.2 too):

void RemoveButton(ButtonArray *array, int butnum)
{
  Button *temp, *temp2;

  if (butnum == 0) {
    temp2 = array->head;
  } else {
    temp = find_n(array, butnum-1);
    if (temp == NULL) return;
    temp2 = temp->next;
  }
  if (temp2 == NULL) return;
  temp->next = temp2->next;

  if (array->tail == temp2) array->tail = temp;

  ButtonDelete(temp2);
  array->count--;
  if (temp != array->head)
    temp = temp->next;
  for (; temp!=NULL; temp=temp->next)
    temp->needsupdate = 1;

  ArrangeButtonArray(array);
}

The reason is that when the last button in the internal list was deleted,
the code tried to access 'temp2->next' although temp2 might be NULL. I didn't
check that fix myself, so it would be nice if you could verify it.

Bye

Dominik ^_^

--
Dominik Vogt, dominik.vogt_at_gmx.de
Reply-To: dominik.vogt_at_gmx.de
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Mon Jun 14 1999 - 15:24:15 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:02 BST