Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!bloom-beacon!TUB.BITNET!net From: net@TUB.BITNET (Oliver Laumann) Newsgroups: comp.windows.x Subject: Re: Xt Problem [XtDispatchEvent()] Message-ID: <8902161223.AA01554@tub.UUCP> Date: 16 Feb 89 12:23:07 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 27 > > XtDispatchEvent() is not re-entrant. > > According to Paul Asente, XtDispatchEvent is fully reentrant in X11R3. But it isn't. XtDispatchEvent() sets a global variable to point to a local variable in the line reading _XtDestroyList = &destroyList; (destroyList is a local variable of XtDispatchEvent()). The value of _XtDestroyList is restored at the end of XtDispatchEvent(). When XtDispatchEvent() is left via a non-local goto (e.g. by calling longjmp() from within a callback), the value of _XtDestroyList becomes meaningless. This can cause a subsequent call to XtDestroyWidget() to produce a segmentation fault or bus error. Am I missing something? Oh, by the way, the line preceding the one quoted above in Event.c is a comment reading "This is pretty gross.". Regards, -- Oliver Laumann net@TUB.BITNET net@tub.UUCP