Debian Bug report logs -
#315444
eval false || true exits set -e script
Reported by: Frans Pop <fjp@debian.org>
Date: Wed, 15 Jun 2005 23:18:02 UTC
Severity: grave
Fixed in version busybox/1:1.00-3
Done: Bastian Blank <waldi@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Frans Pop <fjp@debian.org>:
New Bug report received and forwarded. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Package: debootstrap-udeb
Version: 0.3.1
Severity: grave
Two errors in "functions" breaking new installations have been confirmed
testing debootstrap udeb in sid during an emulated S/390 installation.
The following 2 changes will fix them.
===
local totaldebs=0
- local leftoverdebs="$*"
+ local leftoverdebs="$@"
for c in $COMPONENTS; do
if [ "$countdebs" -ge "$numdebs" ]; then break; fi
===
fi
done
- echo >&3 ${leftover# }
+ echo >&5 ${leftover# }
)
}
---
local pkgdest="$TARGET/$($DLDEST pkg $SUITE $c $ARCH $m $path)"
if [ ! -e "$pkgdest" ]; then continue; fi
- pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 3>&1 1>&4)"
+ pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 5>&1 1>&4)"
if [ "$pkgs_to_get" = "" ]; then break; fi
done 4>&1
===
With these two changes base-installation finishes successfully, with
good progress information on VT1.
There _is_ another error from debootstrap at the very end:
The debootstrap program exited with an error (return value 1).
The logs had already been copied and the /target/debootstrap dir was gone.
I have not (yet) been able to trace this bug. At first I thought it could
be caused by the fact that I was running the script "set -x", but the same
errors occurs without "set -x".
The last lines in /target/var/log/bootstrap.log (with "set -x") were:
+ info BASESUCCESS Base system installed successfully.
+ local name=BASESUCCESS
+ local fmt=Base system installed successfully.
+ shift
+ shift
+ [ yes ]
+ echo I: BASESUCCESS
+ echo IF: Base system installed successfully.
I will try to debug this further tomorrow.
Cheers,
FJP
[Message part 2 (application/pgp-signature, inline)]
Tags added: d-i
Request was from Frans Pop <aragorn@tiscali.nl>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Frans Pop <aragorn@tiscali.nl>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #12 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Oops. Colin just noticed my first "patch" is reversed.
Should be:
- local leftoverdebs="$@"
+ local leftoverdebs="$*"
(but you already knew that :-)
[Message part 2 (application/pgp-signature, inline)]
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Frans Pop <aragorn@tiscali.nl>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #17 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
I've tried to trace the last remaining error.
As far as I can tell, this problem is not in debootstrap, so it would have
to be in d-i's run-debootstrap.
I have done an install with extra debugging statements around the last
statements in debootstrap (see deboot.debug), but even with an explicit
'exit 0' I still get the error message "The debootstrap program exited
with an error (return value 1).".
The output of the debug statements is in deboot.fjp.
You could consider adding an explicit 'exit 0' at the end of the script
anyway.
Cheers,
FJP
[deboot.debug (text/plain, attachment)]
[deboot.fjp (text/plain, attachment)]
[Message part 4 (application/pgp-signature, inline)]
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #22 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Here's a transcript of a strace of base-installer as it finishes running
debootstrap just before it displays the error message:
read(0, "0 Base system installed successf"...,4096) = 38
waitpid(16112, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0} = 16112
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn() = ? (mask now [])
So it's doing a waitpid before the child exits; it's not clear to me if
the waitpid is in fact waiting until the child exits or not from this
strace. Of course, it should, wait, but something wird is going on. The
WIFEXITED flag suggests it did, the SIGCHLD handler firing afterwards
suggests maybe not.
Anyway, the WEXITSTATUS is 1 and that's why it displays the dialog.
Note that run-debootstrap does trap SIGCHLD and its handler is still
operational when it calls waitpid.
--
see shy jo
[signature.asc (application/pgp-signature, inline)]
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #27 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Well, I've ruled out the SIGCHLD handler as having anything to do with
the problem.
--
see shy jo
[signature.asc (application/pgp-signature, inline)]
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #32 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
I tried attaching strace to debootstrap instead, this showed it forking
off a child process at the end, waiting on it, and getting a WEXITSTATUS
of 1. run-debootstrap is out of the picture.
I'm pretty sure the problem is in the exit_function, this explains why set -x
makes it look like it exits zero. But somehow it's failing. Actually, I
suspect the exit_function gets run twice, once by the main debootstrap but
before that, by its child process, which is started by the new call to
second_stage_install. This causes things like umount /target/dev/pts to fail,
and also I've noticed that after its exit, /target/proc is still mounted.
Aj and I did some more poking at it; I tried a modification he
suggested, changing this:
eval $(eval echo \${EXIT_THING_$n}) 2>/dev/null || true
To this:
eval \${EXIT_THING_$n} 2>/dev/null || true
This didn't change anything I could see. I've attached a strace of
debootstrap with that change (and with set -x so you can kinda see what
shell stuff it's doing).
Adding a hash in front of that line does avoid the problem..
--
see shy jo
[log.gz (application/octet-stream, attachment)]
[signature.asc (application/pgp-signature, inline)]
Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#314373; Package debootstrap-udeb.
(full text, mbox, link).
Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>.
(full text, mbox, link).
Message #37 received at 314373@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
joey@dragon:~>cat test
set -e
eval false || true
exit 0
joey@dragon:~>busybox sh test
zsh: exit 1 busybox sh test
joey@dragon:~>sh test
joey@dragon:~>dash test
joey@dragon:~>bash test
joey@dragon:~>zsh test
joey@dragon:~>
Workarond is to enclose the eval statement in parens, so this will work in
debootstrap:
(eval $(eval echo \${EXIT_THING_$n})) 2>/dev/null || true
Cloning the bug to busybox, I'm using 1.00 in the test above, though
busybox-cvs must also have the bug.
--
see shy jo
[signature.asc (application/pgp-signature, inline)]
Changed Bug title.
Request was from Joey Hess <joeyh@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#315444; Package busybox.
(full text, mbox, link).
Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>.
(full text, mbox, link).
Message #48 received at 315444@bugs.debian.org (full text, mbox, reply):
On Wed, Jun 22, 2005 at 02:15:22PM -0400, Joey Hess wrote:
> joey@dragon:~>cat test
> set -e
> eval false || true
> exit 0
> joey@dragon:~>busybox sh test
> zsh: exit 1 busybox sh test
> joey@dragon:~>sh test
> joey@dragon:~>dash test
> joey@dragon:~>bash test
> joey@dragon:~>zsh test
> joey@dragon:~>
>
> Workarond is to enclose the eval statement in parens, so this will work in
> debootstrap:
>
> (eval $(eval echo \${EXIT_THING_$n})) 2>/dev/null || true
>
> Cloning the bug to busybox, I'm using 1.00 in the test above, though
> busybox-cvs must also have the bug.
This is a rather hacky patch against busybox-cvs (but should apply to
busybox without too much trouble) for this.
Unfortunately I had to take the approach of avoiding throwing the
exception in the first place, necessitating a static variable, rather
than catching the exception in evalbltin() if flags & EV_TESTED, which I
think would have been much neater. However, when I tried to take the
latter approach, I apparently didn't manage to restore all the
pre-exception state properly or something, because immediately after
evaluating 'eval false || true' the (interactive) shell decided it had
hit EOF on input and exited. Somebody who understands busybox ash better
might want to look into this.
I also haven't run this through a shell test suite to make sure I didn't
break anything else. That really needs to happen before applying this to
the Debian package.
diff -u busybox-cvs-20040623/shell/ash.c busybox-cvs-20040623/shell/ash.c
--- busybox-cvs-20040623/shell/ash.c
+++ busybox-cvs-20040623/shell/ash.c
@@ -1218,7 +1218,7 @@
-static void evalstring(char *);
+static void evalstring(char *, int);
union node; /* BLETCH for ansi C */
static void evaltree(union node *, int);
static void evalbackcmd(union node *, struct backcmd *);
@@ -1229,6 +1229,8 @@
static int skipcount; /* number of levels to skip */
static int funcnest; /* depth of function calls */
+static int bltintested = 0; /* builtin command tested; appease set -e */
+
/* reasons for skipping commands (see comment on breakcmd routine) */
#define SKIPBREAK 1
#define SKIPCONT 2
@@ -2692,7 +2694,7 @@
static void expredir(union node *);
static void evalpipe(union node *, int);
static void evalcommand(union node *, int);
-static int evalbltin(const struct builtincmd *, int, char **);
+static int evalbltin(const struct builtincmd *, int, char **, int);
static int evalfun(struct funcnode *, int, char **, int);
static void prehash(union node *);
static int bltincmd(int, char **);
@@ -2732,7 +2734,7 @@
STPUTC('\0', concat);
p = grabstackstr(concat);
}
- evalstring(p);
+ evalstring(p, bltintested ? EV_TESTED : 0);
}
return exitstatus;
}
@@ -2743,7 +2745,7 @@
*/
static void
-evalstring(char *s)
+evalstring(char *s, int flags)
{
union node *n;
struct stackmark smark;
@@ -2752,7 +2754,7 @@
setinputstring(s);
while ((n = parsecmd(0)) != NEOF) {
- evaltree(n, 0);
+ evaltree(n, flags);
popstackmark(&smark);
if (evalskip)
break;
@@ -3387,7 +3389,7 @@
}
listsetvar(list, i);
}
- if (evalbltin(cmdentry.u.cmd, argc, argv)) {
+ if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) {
int exit_status;
int i, j;
@@ -3432,9 +3434,10 @@
}
static int
-evalbltin(const struct builtincmd *cmd, int argc, char **argv) {
+evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags) {
char *volatile savecmdname;
struct jmploc *volatile savehandler;
+ volatile int savebltintested;
struct jmploc jmploc;
int i;
@@ -3446,10 +3449,14 @@
commandname = argv[0];
argptr = argv + 1;
optptr = NULL; /* initialize nextopt */
+ savebltintested = bltintested;
+ if (flags & EV_TESTED)
+ bltintested = 1;
exitstatus = (*cmd->builtin)(argc, argv);
flushall();
cmddone:
exitstatus |= ferror(stdout);
+ bltintested = savebltintested;
commandname = savecmdname;
exsig = 0;
handler = savehandler;
@@ -7966,7 +7973,7 @@
state3:
state = 4;
if (minusc)
- evalstring(minusc);
+ evalstring(minusc, 0);
if (sflag || minusc == NULL) {
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
@@ -11817,7 +11824,7 @@
p = trap[p - q + 1];
if (!p)
continue;
- evalstring(p);
+ evalstring(p, 0);
exitstatus = savestatus;
}
}
@@ -11910,7 +11917,7 @@
handler = &loc;
if ((p = trap[0]) != NULL && *p != '\0') {
trap[0] = NULL;
- evalstring(p);
+ evalstring(p, 0);
}
flushall();
#ifdef CONFIG_FEATURE_COMMAND_SAVEHISTORY
--
Colin Watson [cjwatson@debian.org]
Reply sent to Bastian Blank <waldi@debian.org>:
You have taken responsibility.
(full text, mbox, link).
Notification sent to Frans Pop <fjp@debian.org>:
Bug acknowledged by developer.
(full text, mbox, link).
Message #53 received at 315444-close@bugs.debian.org (full text, mbox, reply):
Source: busybox
Source-Version: 1:1.00-3
We believe that the bug you reported is fixed in the latest version of
busybox, which is due to be installed in the Debian FTP archive:
busybox-floppy-udeb_1.00-3_i386.udeb
to pool/main/b/busybox/busybox-floppy-udeb_1.00-3_i386.udeb
busybox-static_1.00-3_i386.deb
to pool/main/b/busybox/busybox-static_1.00-3_i386.deb
busybox-udeb_1.00-3_i386.udeb
to pool/main/b/busybox/busybox-udeb_1.00-3_i386.udeb
busybox_1.00-3.diff.gz
to pool/main/b/busybox/busybox_1.00-3.diff.gz
busybox_1.00-3.dsc
to pool/main/b/busybox/busybox_1.00-3.dsc
busybox_1.00-3_i386.deb
to pool/main/b/busybox/busybox_1.00-3_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 315444@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Bastian Blank <waldi@debian.org> (supplier of updated busybox package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Tue, 28 Jun 2005 14:45:54 +0200
Source: busybox
Binary: busybox-floppy-udeb busybox busybox-udeb busybox-static
Architecture: source i386
Version: 1:1.00-3
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Bastian Blank <waldi@debian.org>
Description:
busybox - Tiny utilities for small and embedded systems
busybox-floppy-udeb - Tiny utilities for the debian-installer floppy images (udeb)
busybox-static - Standalone rescue shell with tons of builtin utilities
busybox-udeb - Tiny utilities for the debian-installer (udeb)
Closes: 315444
Changes:
busybox (1:1.00-3) unstable; urgency=low
.
* shell/ash.c:
- Fix eval. (closes: #315444)
Files:
e5acda5cb48fff5d5dffab98043681de 690 - optional busybox_1.00-3.dsc
47d86efd9b1560a2a6b8a9a1d42c3e51 174613 - optional busybox_1.00-3.diff.gz
866d8924b84249e8b1cac8685d8a43c8 133184 utils optional busybox_1.00-3_i386.deb
da007aa04493c2b84b5fc717dd6016ac 681128 shells optional busybox-static_1.00-3_i386.deb
c62dcaae7a6a95f3e8f4234516fa38a5 135130 debian-installer extra busybox-udeb_1.00-3_i386.udeb
ffa742d8035d0338f56ef1ad817ba174 59960 debian-installer extra busybox-floppy-udeb_1.00-3_i386.udeb
package-type: udeb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iEYEARECAAYFAkLBSSYACgkQLkAIIn9ODhFOdgCcDVq25VQAcbOakO92F4vZ3lJx
d/cAn31q5pQphk2bZ6KF5DKV6RG3uqaa
=e47E
-----END PGP SIGNATURE-----
Tags removed: d-i
Request was from Joey Hess <joeyh@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Mon, 25 Jun 2007 10:10:09 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Tue Aug 14 22:47:31 2018;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.