[129] in The Cryptographic File System users list

home help back first fref pref prev next nref lref last post

Signal handling problem with Linux

daemon@ATHENA.MIT.EDU (Alexandre Stervinou)
Sat Apr 24 10:15:12 1999

From owner-cfs-users@nsa.research.att.com Sat Apr 24 14:15:11 1999
Return-Path: <owner-cfs-users@nsa.research.att.com>
Delivered-To: cfs-mtg@bloom-picayune.mit.edu
Received: (qmail 3294 invoked from network); 24 Apr 1999 14:15:10 -0000
Received: from unknown (HELO mail-green.research.att.com) (135.207.30.103)
  by bloom-picayune.mit.edu with SMTP; 24 Apr 1999 14:15:10 -0000
Received: from amontillado.research.att.com (amontillado.research.att.com [135.207.24.32])
	by mail-green.research.att.com (Postfix) with ESMTP
	id 00C0E1E007; Sat, 24 Apr 1999 10:15:09 -0400 (EDT)
Received: from nsa.research.att.com (majordomo@nsa.research.att.com [135.207.24.155])
	by amontillado.research.att.com (8.8.7/8.8.7) with ESMTP id KAA24775;
	Sat, 24 Apr 1999 10:15:03 -0400 (EDT)
Received: (from majordomo@localhost) by nsa.research.att.com (8.7.3/8.7.3) id KAA14684 for cfs-users-list; Sat, 24 Apr 1999 10:15:18 -0400 (EDT)
X-Authentication-Warning: nsa.research.att.com: majordomo set sender to owner-cfs-users@nsa.research.att.com using -f
Received: from mail-green.research.att.com (mail-green.research.att.com [135.207.30.103]) by nsa.research.att.com (8.7.3/8.7.3) with ESMTP id KAA14680 for <cfs-users@nsa.research.att.com>; Sat, 24 Apr 1999 10:15:16 -0400 (EDT)
Received: by mail-green.research.att.com (Postfix)
	id 177C81E013; Sat, 24 Apr 1999 10:14:09 -0400 (EDT)
Delivered-To: cfs-users@research.att.com
Received: from neouvielle.enserb.u-bordeaux.fr (neouvielle.enserb.u-bordeaux.fr [147.210.18.138])
	by mail-green.research.att.com (Postfix) with ESMTP id 83D9B1E007
	for <cfs-users@research.att.com>; Sat, 24 Apr 1999 10:14:08 -0400 (EDT)
Received: from bataille (stervino@bataille [147.210.19.58]) by neouvielle.enserb.u-bordeaux.fr (8.9.3/8.6.10) with SMTP id QAA28353 for <cfs-users@research.att.com>; Sat, 24 Apr 1999 16:14:07 +0200 (MET DST)
Message-ID: <3721D1AE.5C4E@info.enserb.u-bordeaux.fr>
Date: Sat, 24 Apr 1999 16:14:06 +0200
From: Alexandre Stervinou <stervino@info.enserb.u-bordeaux.fr>
Organization: ENSERB, Bordeaux, France
X-Mailer: Mozilla 3.04 (X11; I; SunOS 5.7 sun4u)
MIME-Version: 1.0
To: cfs-users@research.att.com
Subject: Signal handling problem with Linux
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-cfs-users@research.att.com
Precedence: bulk
Return-Path: <owner-cfs-users@nsa.research.att.com>

OS version  : Linux 2.0.36
CFS version : 1.4.0 Beta 2

Bonjour,

  I'd like to apologize if it's already known, but I found a problem
when I started playing with CFS a few days ago : cmkdir froze strangely
after having entered the secret key. A strace gave me the origin of the
problem, which concerns in fact the signal handling code in file
truerand.c . I think the context is not restored properly with setjmp()
and longjmp(), whereas the use of sigsetjmp() and siglongjmp() will also
restore blocked signals. Here's a little patch :

------------Patch begins-----------------

--- truerand.c	Sun Dec  7 06:16:36 1997
+++ truerand.c	Mon Apr 19 01:42:39 1999
@@ -110,7 +110,7 @@
 interrupt()
 {
 	if (count)
-		longjmp(env, 1);
+		siglongjmp(env, 1);
 	(void) signal(SIGALRM, interrupt);
 	tick();
 }
@@ -118,7 +118,7 @@
 static unsigned long
 roulette()
 {
-	if (setjmp(env))
+	if (sigsetjmp(env,1))
 		return count;
 	(void) signal(SIGALRM, interrupt);
 	count = 0;

------------Patch ends--------------------

-- 
Alexandre Stervinou
e-mail  : stervino@info.enserb.u-bordeaux.fr
PGP key : available at
http://www.enserb.u-bordeaux.fr/~stervino/pgp.html

home help back first fref pref prev next nref lref last post