Skip to content

Commit 44c1c52

Browse files
committed
M9.R.37.2: fix launcher $@ clobber that silently dropped --automated args
ROOT CAUSE OF THE M9.R.36 SILENT WEDGE. reproos-installer-launcher.sh used set -- "$d"/*.so* inside a loop body to check whether a /nix/store/*/lib dir had any *.so* files before adding it to LD_LIBRARY_PATH. set -- overwrites the script's positional parameters ($@) on every iteration. The launcher later did exec env ... /usr/bin/reproos-installer "$@" — but by then $@ had been clobbered to whatever the LAST loop iteration's glob expanded to. By alphabetical /nix/store ordering that was /nix/store/.../pcsclite-2.3.0-lib/lib/*.so*, so the installer was exec-ed with six libpcsclite .so paths as its argv — and --automated /etc/reproos/auto-config.toml was silently DROPPED. Consequence: the installer fell into GUI mode (no --automated flag), constructed a QQmlApplicationEngine, loaded main.qml, walked every nix-store /lib dir in LD_LIBRARY_PATH searching for libc.so.6 + QtQuick.Controls. That dlopen() churn (visible in /tmp/installer.strace as an unending sequence of ENOENT openat calls against /nix/store/*/lib/libc.so.6) looked like a silent wedge but was just slow non-progress. The actual install() function never ran, which is why Phase 1 / Phase 2 / appendLog stderr lines never appeared. FIX: wrap the glob-existence test in a subshell so $@ is not clobbered: if ( set -- "$d"/*.so*; [ -e "$1" ] ); then ... fi The same buggy pattern lived in the sister GUI launcher (/usr/bin/reproos-installer-launcher); that one execs sway not the installer so the user-visible symptom was masked, but the fix is identical and lands here too as a regression guard. Diagnostic infrastructure from M9.R.37.1 (strace -f -ttt + kernel stack sampler + stdbuf -oL -eL) stays in place — useful for future gaps. The current sampler tracks PID $$ recorded BEFORE the strace exec; after exec $$ becomes strace itself (which sits in do_wait), so the visible kernel stacks are strace's wait4, not the installer's. Re-run with this fix should expose Phase 1+'s actual behaviour.
1 parent d6c6c93 commit 44c1c52

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

recipes/reproos-iso/scripts/stage-de-rootfs.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,20 @@ fi
474474
# Debian-installed libc.so.6 with a foreign nix-store glibc (which
475475
# would break every Debian binary in the chain).
476476
_repro_nix_dirs=""
477+
# M9.R.37.2 — use a subshell for the glob-existence test so the
478+
# script's positional parameters ($@) are not clobbered. This GUI
479+
# launcher doesn't pass $@ to the installer (it execs sway, then sway
480+
# execs the installer via SWAY_INIT), but the hygiene fix matches the
481+
# sister-launcher fix in the ``.sh`` variant and prevents future
482+
# regressions.
477483
for d in /nix/store/*/lib; do
478484
[ -d "$d" ] || continue
479485
case "$d" in
480486
/nix/store/*-glibc-*/lib) continue ;;
481487
esac
482-
set -- "$d"/*.so*
483-
[ -e "$1" ] || continue
488+
if ! ( set -- "$d"/*.so*; [ -e "$1" ] ); then
489+
continue
490+
fi
484491
if [ -z "$_repro_nix_dirs" ]; then
485492
_repro_nix_dirs="$d"
486493
else
@@ -603,15 +610,26 @@ _repro_nix_libs=""
603610
_repro_qt_plugins=""
604611
_repro_qml_imports=""
605612
_repro_qpa_plugins=""
613+
# M9.R.37.2 — DO NOT use ``set -- "$d"/*.so*`` to test for the glob
614+
# existence: ``set --`` overwrites the script's positional parameters
615+
# ($@), which is what we ultimately pass to ``reproos-installer``.
616+
# The previous M9.R.36.1 launcher (this script's prior shape) clobbered
617+
# $@ on every loop iteration and ended up exec-ing the installer with
618+
# the LAST nix-store dir's ``*.so*`` glob expansion as its argv —
619+
# silently dropping ``--automated /etc/reproos/auto-config.toml``,
620+
# so the installer fell into GUI mode + QML engine init + endless
621+
# dlopen() churn through LD_LIBRARY_PATH (the M9.R.36 "silent wedge
622+
# after Qt init"). Use a subshell's exit code instead: if the first
623+
# entry of the expansion exists, the subshell succeeds; otherwise it
624+
# fails. $@ is untouched.
606625
for d in /nix/store/*/lib; do
607626
[ -d "$d" ] || continue
608627
# Skip glibc dirs — Debian system glibc must remain canonical so
609628
# every Debian binary in the live ISO chain keeps working.
610629
case "$d" in
611630
/nix/store/*-glibc-*/lib) continue ;;
612631
esac
613-
set -- "$d"/*.so*
614-
if [ -e "$1" ]; then
632+
if ( set -- "$d"/*.so*; [ -e "$1" ] ); then
615633
if [ -z "$_repro_nix_libs" ]; then
616634
_repro_nix_libs="$d"
617635
else

0 commit comments

Comments
 (0)