GNU bug report logs - #7690
23.2; lwlib-Xm.c

Previous Next

Package: emacs;

Reported by: <weme24 <at> gmx.net>

Date: Mon, 20 Dec 2010 20:15:03 UTC

Severity: serious

Found in version 23.2

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7690 in the body.
You can then email your comments to 7690 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7690; Package emacs. (Mon, 20 Dec 2010 20:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to <weme24 <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Dec 2010 20:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <weme24 <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; lwlib-Xm.c
Date: Mon, 20 Dec 2010 20:41:19 +0100
While using ispell-buffer my Emacs crashed. After examining the
core-dump I found the following:

in lwlib/lwlib-Xm.c
when val->contens=0
------------------------------------------------------------
static void
xm_update_menu (widget_instance* instance,
                Widget widget,
                widget_value* val,
                Boolean deep_p)
{
  Widget* children;
  unsigned int num_children;
  int num_children_to_keep = 0;
  int i;
  widget_value* cur;

  children = XtCompositeChildren (widget, &num_children);

  /* Widget is a RowColumn widget whose contents have to be updated
   * to reflect the list of items in val->contents */

  /* See how many buttons we can keep, and how many we
     must completely replace.  */
  if (val->contents == 0)
    num_children_to_keep = 0;
  else if (val->contents->change == STRUCTURAL_CHANGE)
    {
      if (children)
	{
	  for (i = 0, cur = val->contents;
               (i < num_children
		&& cur); /* how else to ditch unwanted children ?? - mgd */
	       i++, cur = cur->next)
	    {
	      if (cur->this_one_change == STRUCTURAL_CHANGE)
		break;
	    }

	  num_children_to_keep = i;
	}
    }
  else
    num_children_to_keep = num_children;

  /* Update all the buttons of the RowColumn, in order,
     except for those we are going to replace entirely.  */
  if (children)
    {
      for (i = 0, cur = val->contents; i < num_children_to_keep; i++)
	{
	  if (!cur)
	    {
	      num_children_to_keep = i;
	      break;
	    }
	  if (children [i]->core.being_destroyed
	      || strcmp (XtName (children [i]), cur->name))
	    continue;
	  update_one_menu_entry (instance, children [i], cur, deep_p);
	  cur = cur->next;
	}
    }

  /* Now replace from scratch all the buttons after the last
     place that the top-level structure changed.  */
  if (val->contents->change == STRUCTURAL_CHANGE)       <-- CRASH !!!!
    {
      destroy_all_children (widget, num_children_to_keep);
      make_menu_in_widget (instance, widget, val->contents,
                           num_children_to_keep);
    }

  XtFree ((char *) children);
}
------------------------------------------------------------

So I wrote a quick workaround:

------------------------------------------------------------

--- emacs-23.2/lwlib/lwlib-Xm.c.org     2010-12-16 22:45:47.000000000 +0100
+++ emacs-23.2/lwlib/lwlib-Xm.c 2010-12-16 22:47:11.000000000 +0100
@@ -825,7 +825,7 @@
 
   /* Now replace from scratch all the buttons after the last
      place that the top-level structure changed.  */
-  if (val->contents->change == STRUCTURAL_CHANGE)
+  if (val->contents && val->contents->change == STRUCTURAL_CHANGE)
     {
       destroy_all_children (widget, num_children_to_keep);
       make_menu_in_widget (instance, widget, val->contents,

------------------------------------------------------------

That fixed the problem for me






Severity set to 'serious' from 'normal' Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Tue, 21 Dec 2010 08:06:01 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7690; Package emacs. (Sun, 23 Jan 2011 21:34:02 GMT) Full text and rfc822 format available.

Message #10 received at 7690 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: weme24 <at> gmx.net
Cc: 7690 <at> debbugs.gnu.org
Subject: Re: 23.2; lwlib-Xm.c
Date: Sun, 23 Jan 2011 16:41:06 -0500
> While using ispell-buffer my Emacs crashed.  After examining the
> core-dump I found the following:
>
> in lwlib/lwlib-Xm.c
> when val->contens=0
>
> So I wrote a quick workaround:

Thanks.  This looks correct, and I've committed it.  Sorry for the long
delay.




bug closed, send any further explanations to <weme24 <at> gmx.net> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sun, 23 Jan 2011 21:34:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Feb 2011 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.