Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpl-opus!hpnmdla!darrylo From: darrylo@hpnmdla.HP.COM (Darryl Okahata) Newsgroups: comp.sys.hp Subject: Re: Interrupted library calls Message-ID: <430017@hpnmdla.HP.COM> Date: 17 Jan 90 02:14:25 GMT References: <373@node17.mecazh.UUCP> Organization: HP Network Measurements Div, Santa Rosa, CA Lines: 33 In comp.sys.hp, paul@mecazh.UUCP (Paul Breslaw) writes: > This problem cropped up in the context of Xlib, but could equally apply to > any Unix library. Hence the posting to more than one group. > > Our application (a CAM package on HP9000/3xx machines under HP-UX6.5 X11.R2) > crashes sometimes when we handle a signal and return from > the signal handler in a different context from the one in which the handler > was entered. In other words we do a longjmp(3) from inside the handler. > > We found that this is an elegant way to design certain features into a program. [ You're not going to like this ... ] This was one of the problems discussed in comp.windows.x some time back: you cannot interrupt (via a signal) an X-window library call (at least this is true of X11R2 and, I believe, X11R3 -- I'm not sure about X11R4, however). As this is a generic problem with X-windows (this is not an "HP" problem), you have the following choices: 1. Don't use signals (even to just set a flag and return). 2. Temporarily block *ALL* signals during a X-window call. This is, I believe, the approach taken by GNU Emacs. -- Darryl Okahata UUCP: {hplabs!, hpcea!, hpfcla!} hpnmd!darrylo Internet: darrylo%hpnmd@hpcea.HP.COM DISCLAIMER: this message is the author's personal opinion and does not constitute the support, opinion or policy of Hewlett-Packard or of the little green men that have been following him all day.