I continue to struggle with making bup tests not hang because of the new
"script" usage, and I keep confusing myelf. This note serves to explain
where I am, ask if anyone else is testing on a BSD flavor, and I hope to
force me to be clearer with myself when writing it.
The basic issue is
dev
which tries to invoke script multiple ways as an autoconf-style probe to
decide which form to use.
The arguments that it tries are:
-q: Don't print Script started, Script done.
-e: Exit with the status of shell or command, instead of success.
-c: Execute this command, instead of the shell.
script is not specified by POSIX. The 4.4-Lite2 man page says it was
introduced in 3.0BSD, and the only arguments are -a for append and the
file.
NetBSD 6 documents -q and -c, and this seems to continue to NetBSD 9.
NetBSD 10 documents all 3 flags.
Old OpenBSD is like 4.4-Lite2, and 6.3 adds -c; that continues to 6.9.
FreeBSD 10 has -q, and many others, but not -c -or -e. Only in FreeBSD
13 is -e accepted, but -c is not.
See
https://man.bsd.lv/ for historical man pages if you wish :-)
On NetBSD 10, which should be ok with all of this, tests hang with
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
12345 1803 1 28859 29 0 17652 1072 parked I+ pts/37 0:00.00 script -qec true /dev/null
and script was started 14 minutes ago. With gdb, that's starting to
look like a script bug (or some deep async-signal-safe fail) that I am
having trouble provoking outside of bup tests.
[Switching to LWP 1803 of process 1803]
0x00007f7f9aa0abba in ___lwp_park60 () from /usr/libexec/ld.elf_so
(gdb) bt
#0 0x00007f7f9aa0abba in ___lwp_park60 () from /usr/libexec/ld.elf_so
#1 0x00007f7f9aa05d45 in _rtld_exclusive_enter () from /usr/libexec/ld.elf_so
#2 0x00007f7f9aa0680d in _rtld_exit () from /usr/libexec/ld.elf_so
#3 0x000079176e95a6c9 in __cxa_finalize () from /usr/lib/libc.so.12
#4 0x000079176e95a3ed in exit () from /usr/lib/libc.so.12
#5 0x00000001cdc0179b in done ()
#6 0x00000001cdc0189a in finish ()
#7 <signal handler called>
#8 0x00007f7f9aa07ff3 in _rtld_symlook_obj () from /usr/libexec/ld.elf_so
#9 0x00007f7f9aa083ea in _rtld_symlook_list () from /usr/libexec/ld.elf_so
#10 0x00007f7f9aa0889f in _rtld_symlook_default () from /usr/libexec/ld.elf_so
#11 0x00007f7f9aa08d4a in _rtld_find_plt_symdef () from /usr/libexec/ld.elf_so
#12 0x00007f7f9aa00bc0 in _rtld_bind () from /usr/libexec/ld.elf_so
#13 0x00007f7f9aa0082d in _rtld_bind_start () from /usr/libexec/ld.elf_so
#14 0x0000000000000246 in ?? ()
#15 0x0000000000002d4f in ?? ()
#16 0x000079176e913b80 in _malloc_prefork () from /usr/lib/libc.so.12
#17 0x00000001cdc0213b in main ()
That leaves three things:
- fix the bug
- ensure that bup avoids it, so people can test anyway
- understand how tests work on FreeBSD, OpenBSD, Dragonfly