X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Thu, 10 Jan 2002 15:27:57 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: roland_asmann AT yahoo DOT com Message-Id: <7263-Thu10Jan2002152756+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <20020110120828.7048.qmail@web9107.mail.yahoo.com> (message from ROLAND on Thu, 10 Jan 2002 04:08:28 -0800 (PST)) Subject: Re: Problem with alarm & signal References: <20020110120828 DOT 7048 DOT qmail AT web9107 DOT mail DOT yahoo DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Thu, 10 Jan 2002 04:08:28 -0800 (PST) > From: ROLAND > > --- Eli Zaretskii wrote: > > `alarm' hooks the timer interrupt, so it sounds like > > PMCOM's interrupt > > handler is not signal-safe or perhaps the > > implementation of `alarm' > > is not safe when other hardware interrupts are > > present. > > Is this something I need to worry about and perhaps > try to change? Or can I work my way around this and > just ignore it? It is something you should worry about. Whether you need to change the code or work around the problem somehow can only be decided after analyzing the code and understanding the problems. In general, code that uses the DS/SS/ES registers in an interrupt handler is unsafe because the DJGPP data segment might be invalid when there's a signal pending. The __djgpp_ds_alias variable is provided for that reason: it always has a value of a valid selector which spans the same memory as what DS usually does. > > Does the Windows message cite any address, and if it > > does, can you > > see (e.g., with a debugger) where in the code is > > that address? > > It does, but the debugger part is still something I'm > working on... Then post the full text of the message here, and someone will help you with the debugger. > Anyway, if I leave 'alarm' out of my code, the program > runs, but crashes on CTRL-C, but if 'alarm' is still > in there, the program crashes while running. Bothe Ctrl-C and the alarm signal work the same way in DJGPP: they both invalidate the DS selector. So I think you should take a good look at the PMCOM's interrupt handler, to see whether it uses the DS selector, or references some variable on the stack.