Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 2002 09:40:03 -0800 (PST)
From:      Sandeep Kumar <skumar@juniper.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/35214: dump program hangs while exiting
Message-ID:  <200203041740.g24He3x39561@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/35214; it has been noted by GNATS.

From: Sandeep Kumar <skumar@juniper.net>
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 <setjmp.h>
 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203041740.g24He3x39561>