Skip to contentSkip to conversation

question on do_sigaltstack() -- want to allow nested calls

DISCUSSION Chris Friesen 1 participant 1 message Oct 5, 2004

lore
Share & tools
lore
#0 lore raw

The man page says that you can't call sigaltstack() while you are actually in the alternate stack.

I have an emulator app that wants to do some special stuff, and it seems to require nested calls. [1]

So...

Is it enough in this case to simply bypass the "if (on_sig_stack(sp))" check in do_sigaltstack()?

Chris

1: Here's why I want to do this, if anyone is interested.

case 1: --the segfault handler is set to run on alt stack, and tries to do some fancy stuff to trace the call chain
--would like to set up alternate stack for SIGSEGV then drop block on that
signal, while still in the handler for the first instance. If we get the second fault, then we die a bit more messily.

case 2: --emulator software sets up handler for SIGTRAP on alt stack
--some routines then have to run code in software being emulated, but we don't
trust it
--would like to set up alternate stacks for signals, then drop blocks on them
and run code being emulated, while still running the first handler