From owner-freebsd-hackers Thu Jun 7 6:22:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from post.webmailer.de (natpost.webmailer.de [192.67.198.65]) by hub.freebsd.org (Postfix) with ESMTP id 5ACF837B401 for ; Thu, 7 Jun 2001 06:22:37 -0700 (PDT) (envelope-from freebsd-ml@econos.de) Received: from stefan-bt (pD95024D6.dip.t-dialin.net [217.80.36.214]) by post.webmailer.de (8.9.3/8.8.7) with SMTP id PAA14707 for ; Thu, 7 Jun 2001 15:22:29 +0200 (MET DST) From: Stefan Hoffmeister To: freebsd-hackers@FreeBSD.ORG Subject: libc_r, signal handler ucontext modification Date: Thu, 07 Jun 2001 15:21:31 +0200 Organization: Econos Message-ID: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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