Newsgroups: comp.windows.x.motif
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!linus!linus!linus!sdl
From: sdl@d74sun.lyra.mitre.org (Steven D. Litvinchouk)
Subject: Re: XmList problem (coredump)
In-Reply-To: uuciks@swbatl.sbc.com's message of Wed, 5 Jun 91 18:27:59 GMT
Message-ID: <SDL.91Jun8225928@d74sun.lyra.mitre.org>
Sender: news@linus.mitre.org (News Service)
Nntp-Posting-Host: d74sun.mitre.org
Organization: The Mitre Corporation, Bedford, MA
References: <1991Jun5.182759.23939@swbatl.sbc.com>
Date: 8 Jun 91 22:59:28


In article <1991Jun5.182759.23939@swbatl.sbc.com> uuciks@swbatl.sbc.com (Kristina Smith - UCI - 5-3793) writes:

> Has anyone ever seen this behavior before?
> I create a selectionBoxDialog like this:
> 
> selectionBox = XmCreateSelectionDialog(parent,"selectionBox",args,argcnt);
> 
> XtUnmanageChild(list);
> XmListDeleteAllItems(list);
> XmListAddItem(list,xmstring,0);
> XtManageChild(list);
> 

> Then when I try to select an item from the new list it coredumps
> with a memory fault (segmentation violation) (not all the time,
> though.  It's very sporadic)

> 
> When I use a debugger on it, and do a trace, this is what shows up:
> _DrawHighlight(0x1ac2a8,0x3,0x1,0x1,0x20000,0x3) + c4
> _ListFocusIn(0x1ac2a8,0xf7ffe7e4,0x0,0x19ad78,0x25,0x26838) + b0
> __XtTranslateEvent(0x1ac2a8,0x0,0xf7ffe7e4,0x630,0x174d74,0x19ad70) + 360
> _DispatchEvent(0xf7ffe7e4,0x1ac2a8,0x200000,0x0,0xf7ffe588,0xf7ffe3f8) + 328

We have encountered *exactly* the same problem.  There appear to be
not one, but two separate bugs in the Motif XmList code:

1.  Deleting all selected items from an unmanaged XmList can cause a
segmentation fault crash.  Workaround: instead of deleting all items,
and then adding items as you have it, instead *first* add the new
items (appended to the end of the list), and *then* delete the old
items--in this way you never delete all items, so no crash.

2.  In a scrolled list, deleting the first item (I don't remember if
it needs to be selected) if the first item has been scrolled so that
it isn't visible will also cause a crash.  Workaround:  scroll the
list so that an item is visible when it is deleted.


By the way, we've also been having *lots* of trouble with the Motif
clipboard.  Anyone else in the same boat?


--
Steven Litvintchouk
MITRE Corporation
Burlington Road
Bedford, MA  01730
(617)271-7753
ARPA:  sdl@mbunix.mitre.org
UUCP:  ...{att,decvax,genrad,necntc,ll-xn,philabs,utzoo}!linus!sdl
	"Where does he get those wonderful toys?"
