From owner-freebsd-bugs Mon Mar 4 9:40:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4FA5637B405 for ; Mon, 4 Mar 2002 09:40:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g24He3x39561; Mon, 4 Mar 2002 09:40:03 -0800 (PST) (envelope-from gnats) Date: Mon, 4 Mar 2002 09:40:03 -0800 (PST) Message-Id: <200203041740.g24He3x39561@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Sandeep Kumar Subject: Re: bin/35214: dump program hangs while exiting Reply-To: Sandeep Kumar Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/35214; it has been noted by GNATS. From: Sandeep Kumar To: freebsd-gnats-submit@FreeBSD.org, skumar@juniper.net Cc: Subject: Re: bin/35214: dump program hangs while exiting Date: Mon, 04 Mar 2002 09:30:39 -0800 Replacing setjmp/pause/longjmp with sigprocmask/sigsuspend fixes the problem. Here is the diff for tape.c Index: tape.c =================================================================== RCS file: /cvs/junos-2001/src/sbin/dump/tape.c,v retrieving revision 1.1.1.4 retrieving revision 1.2 diff -r1.1.1.4 -r1.2 60d59 < #include 124,127d122 < static int ready; /* have we reached the lock point without having */ < /* received the SIGUSR2 signal from the prev slave? */ < static jmp_buf jmpbuf; /* where to jump to if we are ready when the */ < /* SIGUSR2 arrives from the previous slave */ 682,684d676 < < if (ready) < longjmp(jmpbuf, 1); 757a750,755 > sigset_t sigusr2_mask, omask; > > /* Create a mask with SIGUSR2 */ > sigemptyset(&sigusr2_mask); > sigaddset(&sigusr2_mask, SIGUSR2); > 792,797c790,792 < if (setjmp(jmpbuf) == 0) { < ready = 1; < if (!caught) < (void) pause(); < } < ready = 0; --- > sigprocmask(SIG_BLOCK, &sigusr2_mask, &omask); /*Mask SIGUSR2*/; > if (!caught) > (void) sigsuspend(&omask); /* wait for SIGUSR2 */ 798a794 > sigprocmask(SIG_SETMASK, &omask, NULL); /* Set the old mask */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message