Date: Thu, 07 Jun 2001 15:21:31 +0200 From: Stefan Hoffmeister <freebsd-ml@econos.de> To: freebsd-hackers@FreeBSD.ORG Subject: libc_r, signal handler ucontext modification Message-ID: <j5vuhtsb6uoenhdpo23qo2ouerqs0i17lm@4ax.com>
index | next in thread | raw e-mail
Hi,
given the following
* FreeBSD 4.3 Release (i386)
* an application linked against libc_r
* and a signal handler installed with the SA_SIGINFO flag
which implies that the signal handler will be called with
int Signal, int SomethingBoring, uncontext_t* ucontext
ow should the implementation of libc_r (!) behave if the application
modifies the ucontext passed in to the signal handler? In particular, how
should the implementation behave if
the_ucontext->m_context->mc_eip
is modified, setting EIP to, say, a fault handler?
Some random observations:
* Currently libc_r seems to ignore these changes
made to the context.
* When the application is linked against libc,
EIP is switched (i.e. the intended effect takes place);
this implies that the behaviour shown by libc and
libc_r diverges.
* Under Linux, modifying EIP has the intended effect.
I admit that all this is somewhat anecdotal, but I haven't looked in
detail yet at what happens after the signal handler has returned to
uthread/uthread_sig.c -> _thread_sig_wrapper
If someone needs some sample code, I'd be happy to cook up something once
I have booted into FreeBSD again.
Any thoughts?
TIA!
Stefan
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?j5vuhtsb6uoenhdpo23qo2ouerqs0i17lm>
