* longjmp/sigstack problem workaround anyone?
@ 1994-11-09 23:43 Jeremy Casas
0 siblings, 0 replies; only message in thread
From: Jeremy Casas @ 1994-11-09 23:43 UTC (permalink / raw)
Hi, I have a program that calls longjmp() from within a signal handler
that uses a temporary stack installed using sigstack().
The system: DEC 3000 Model 400 AXP - OSF/1 V1.3
The problem: I'm getting a IOT Trap within the longjmp() routine. I
don't have the source for longjmp() but by stepping through the
assembly instructions using dbx, it appears that within longjmp(), a test
like the following is made:
longjmp(jmpbuf)
{
....
target_sp = <get_target_sp from jmpbuf>
if (target_sp < current_sp) {
generate Invalid Operand Trap
}
....
}
While this check is generally beneficial, it generates an IOT in the case
when longjmp() is called from a signal handler using a temporary stack.
Since the temporary stack is allocated in the data segment and the
stack segment is below both the text and data segments, the test
made in longjmp() will always be true. That is, we have the following
case:
- target_sp points to an address in the real stack segment
- current_sp points to an address in the temporary stack in the
data segment
- stack segment is in a lower address than the data segment
- therefore, target_sp is ALWAYS < current_sp --> IOT!
My question: does anyone know of a workaround? any suggestions on how
to resolve this problem?
Thanks in advance!
jeremy
--
Jeremy Casas OGI: casas@cse.ogi.edu (503) 690-1125
Research Associate URL: http://www.cse.ogi.edu/~casas/
Oregon Graduate Institute of Science & Technology
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1994-11-09 23:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-11-09 23:43 longjmp/sigstack problem workaround anyone? Jeremy Casas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox