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

From: Chris Friesen
Date: Tue Oct 05 2004 - 12:11:38 EST



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




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/