Mail Archives: djgpp/2002/01/10/08:31:24
> Date: Thu, 10 Jan 2002 04:08:28 -0800 (PST)
> From: ROLAND <roland_asmann AT yahoo DOT com>
>
> --- Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> 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.
- Raw text -