NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: install/56303: On a fresh installation, /tmp on sparc64 is not sticky



The following reply was made to PR install/56303; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: martin%netbsd.org@localhost
Subject: Re: install/56303: On a fresh installation, /tmp on sparc64 is not
 sticky
Date: Tue, 13 Jul 2021 09:49:54 +0000 (UTC)

 On Tue, 13 Jul 2021, Martin Husemann wrote:
 
 > The other part is that apparently
 >
 > 	progress -zf $(set).tar.xz tar --chroot $(path) -xpf -
 >
 > does not return failure properly. Sounds like a progress(1) or gizp(1)
 > bug to me.
 >
 
 Yeah, there is a bug in progress. Sometimes it won't return an error
 status if gzip is dies or is killed in the middle of extraction:
 
 $ ./progress_test.sh /mnt/amd64/binary/sets/*.xz
 base.tar.xz
   29% |**********                         | 64460 KiB   20.90 MiB/s    00:07 ETA./usr/bin/sqlite3: Truncated tar archive
 tar: Error exit delayed from previous errors.
   32% |***********                        | 71194 KiB   20.80 MiB/s    00:06 ETA
 comp.tar.xz
   16% |*****                              | 92497 KiB   29.91 MiB/s    00:15 ETA./usr/lib/libarchive_p.a: Truncated tar archive
 tar: Error exit delayed from previous errors.
   17% |*****                              | 99147 KiB   29.87 MiB/s    00:14 ETA
 $
 
 Run progress_test.sh, then `pkill -x gzip' in another window.
 
 ---
 #!/bin/sh
 
 set -eu -o pipefail
 trap 'rm -rf X' 0 1 2 3 15
 cd /tmp
 for f
 do      mkdir X
          echo "$(basename "$f")"
          progress -zf $f tar -C X -xf -
          sudo rm -rf X
 done
 ---
 
 This small patch makes progress return the correct exit status:
 
 ---START---
 --- progress.c.orig	2021-07-13 09:23:10.198335692 +0000
 +++ progress.c	2021-07-13 09:21:42.758123880 +0000
 @@ -247,6 +247,11 @@
   	}
   	close(outpipe[1]);
 
 +	progressmeter(1);
 +	signal(SIGPIPE, SIG_DFL);
 +
 +	free(fb_buf);
 +
   	gzipstat = 0;
   	cmdstat = 0;
   	while (pid || gzippid) {
 @@ -258,9 +263,6 @@
   		 * error without sending the signal to ourselves :-(
   		 */
   		ws = WIFSIGNALED(ws) ? WTERMSIG(ws) : WEXITSTATUS(ws);
 -
 -		if (deadpid != -1 && errno == EINTR)
 -			continue;
   		if (deadpid == pid) {
   			pid = 0;
   			cmdstat = ws;
 @@ -274,10 +276,5 @@
   		break;
   	}
 
 -	progressmeter(1);
 -	signal(SIGPIPE, SIG_DFL);
 -
 -	free(fb_buf);
 -
   	exit(cmdstat ? cmdstat : gzipstat);
   }
 ---END---
 
 -RVP
 


Home | Main Index | Thread Index | Old Index