Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bbn.com!metasoft!alan From: alan@metasoft.UUCP (Alan Epstein) Newsgroups: comp.windows.x Subject: Bug in _XtFindRemapWidget ? Message-ID: <1874@metasoft.UUCP> Date: 5 Oct 90 15:03:36 GMT Organization: Meta Software Corporation, Cambridge MA Lines: 31 Recently our application began crashing reliably during a mouse down event in a small widget hierarchy. We traced the problem to _XtFindRemapWidget, which makes a preliminary test to determine whether the pdi->trace array should be refilled (by calling _XtFillAncestorList). In some cases where it decides not to refill the array, the existing array contains garbage, causing a crash later when _XtGetPerWidgetInput tries to dereference through the invalid widget. The bug appears to be due to the possibility that Xt reassigns widget id's, ie: after a widget is destroyed (and presumably its id is freed), XtCreate might return the same id. This new id is valid, but the result is that the test in _XtFindRemapWidget might succeed (ie: widget == pdi->trace[0]) when the other elements in the pdi->trace array are old and obsolete. The fix I am trying involves merely removing the test at the head of _XtFindRemapWidget, causing _XtFillAncestorList to make the array right every time. This seems like little overhead since the latter routine doesn't need to do much. I don't profess to be an expert in the Xt code, so I would appreciate a confirmation by someone who is. ----------------------------- Alan Epstein Meta Software Corp UUCP: ...bbn!metasoft!alan 150 Cambridgepark Dr Internet/ARPA: alan%metasoft@bbn.com Cambridge, MA 02140 USA TEL: (617) 576.6920 -----------------------------