WSL: Ubuntu 17.10 `bash` preinst: ../sysdeps/unix/sysv/linux/spawni.c:360: __spawnix: Assertion `ec >= 0' failed.

Attempting to dist-upgrade to Ubtuntu 17.10 fails (if bash is not marked for hold - see Issue #1878). The reason for this appears to be that the deb package’s preinst script is actually a binary, and the behaviour is odd:

$ ldd bash_4.4-5ubuntu1_amd64/preinst
        linux-vdso.so.1 =>  (0x00007fffdd9fd000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffe838e0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffe83e00000)
$ ./bash_4.4-5ubuntu1_amd64/preinst
preinst: ../sysdeps/unix/sysv/linux/spawni.c:368: __spawnix: Assertion `ec >= 0' failed.
Aborted (core dumped)
$ strace -vvfFtTs 128 -- ./bash_4.4-5ubuntu1_amd64/preinst
11:18:26 execve("./bash_4.4-5ubuntu1_amd64/preinst", ["./bash_4.4-5ubuntu1_amd64/preinst"], ["LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca"..., "HOSTTYPE=x86_64", "LESSCLOSE=/usr/bin/lesspipe %s %s", "LANG=en_GB.UTF-8", "USER=stuart", "PWD=/home/stuart", "HOME=/home/stuart", "NAME=MacPro", "SHELL=/bin/bash", "TERM=xterm-256color", "SHLVL=1", "LOGNAME=stuart", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA "..., "LESSOPEN=| /usr/bin/lesspipe %s", "_=/usr/bin/strace", "OLDPWD=/home/stuart/bash"]) = 0 <0.001087>
11:18:26 brk(NULL)                      = 0x22a4000 <0.000020>
11:18:26 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000027>
11:18:26 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04ec690000 <0.000034>
11:18:26 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000023>
11:18:26 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000184>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=3659174697257185, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=128, st_size=21447, st_atime=2017-10-29T11:06:20+0000.323984500, st_mtime=2017-10-29T11:06:20+0000.324516100, st_ctime=2017-10-29T11:06:20+0000.334001900}) = 0 <0.000024>
11:18:26 mmap(NULL, 21447, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04ec68a000 <0.000051>
11:18:26 close(3)                       = 0 <0.000016>
11:18:26 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000025>
11:18:26 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 <0.000216>
11:18:26 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\22\2\0\0\0\0\0@\0\0\0\0\0\0\0\220\330\35\0\0\0\0\0\0\0\0\0@\0008\0\n\0@\0I\0H\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0"..., 832) = 832 <0.000078>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=1970324836996738, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=3832, st_size=1960656, st_atime=2017-10-28T14:53:28+0100, st_mtime=2017-10-11T21:21:40+0100, st_ctime=2017-10-28T14:53:38+0100.698294300}) = 0 <0.000027>
11:18:26 mmap(NULL, 4061792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04ec020000 <0.000079>
11:18:26 mprotect(0x7f04ec1f6000, 2097152, PROT_NONE) = 0 <0.000025>
11:18:26 mmap(0x7f04ec3f6000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d6000) = 0x7f04ec3f6000 <0.000051>
11:18:26 mmap(0x7f04ec3fc000, 14944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f04ec3fc000 <0.000036>
11:18:26 close(3)                       = 0 <0.000043>
11:18:26 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04ec680000 <0.000034>
11:18:26 arch_prctl(ARCH_SET_FS, 0x7f04ec680740) = 0 <0.000016>
11:18:26 mprotect(0x7f04ec3f6000, 16384, PROT_READ) = 0 <0.000023>
11:18:26 mprotect(0x602000, 4096, PROT_READ) = 0 <0.000017>
11:18:26 mprotect(0x7f04ec627000, 4096, PROT_READ) = 0 <0.000016>
11:18:26 munmap(0x7f04ec68a000, 21447)  = 0 <0.000062>
11:18:26 access("/bin/sh", X_OK)        = 0 <0.000118>
11:18:26 openat(AT_FDCWD, "/dev/null", O_WRONLY) = 3 <0.000030>
11:18:26 fcntl(3, F_GETFD)              = 0 <0.000019>
11:18:26 fcntl(3, F_SETFD, FD_CLOEXEC)  = 0 <0.000017>
11:18:26 pipe([4, 5])                   = 0 <0.000032>
11:18:26 fcntl(4, F_GETFD)              = 0 <0.000017>
11:18:26 fcntl(4, F_SETFD, FD_CLOEXEC)  = 0 <0.000020>
11:18:26 fcntl(5, F_GETFD)              = 0 <0.000017>
11:18:26 fcntl(5, F_SETFD, FD_CLOEXEC)  = 0 <0.000016>
11:18:26 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=64*1024}) = 0 <0.000015>
11:18:26 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=64*1024}) = 0 <0.000017>
11:18:26 brk(NULL)                      = 0x22a4000 <0.000015>
11:18:26 brk(0x22c5000)                 = 0x22c5000 <0.000038>
11:18:26 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=64*1024}) = 0 <0.000016>
11:18:26 prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=64*1024}) = 0 <0.000016>
11:18:26 mmap(NULL, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f04ec670000 <0.000031>
11:18:26 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0 <0.000016>
11:18:26 clone(child_stack=0x7f04ec678ff0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) = 29707 <0.000659>

strace: Process 29707 attached

[pid 29706] 11:18:26 write(2, "preinst: ../sysdeps/unix/sysv/linux/spawni.c:368: __spawnix: Assertion `ec >= 0' failed.\n", 89preinst: ../sysdeps/unix/sysv/linux/spawni.c:368: __spawnix: Assertion `ec >= 0' failed.
 <unfinished ...>
[pid 29707] 11:18:26 rt_sigprocmask(SIG_BLOCK, NULL,  <unfinished ...>
[pid 29706] 11:18:26 <... write resumed> ) = 89 <0.000755>
[pid 29707] 11:18:26 <... rt_sigprocmask resumed> ~[KILL STOP], 8) = 0 <0.000402>
[pid 29706] 11:18:26 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 <unfinished ...>
[pid 29707] 11:18:26 rt_sigaction(SIGHUP, NULL,  <unfinished ...>
[pid 29706] 11:18:26 <... mmap resumed> ) = 0x7f04ec660000 <0.000345>
[pid 29707] 11:18:26 <... rt_sigaction resumed> {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fdd05217140}, 8) = 0 <0.000394>
[pid 29706] 11:18:26 rt_sigprocmask(SIG_UNBLOCK, [ABRT],  <unfinished ...>
[pid 29707] 11:18:26 rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f04ec057140},  <unfinished ...>
[pid 29706] 11:18:26 <... rt_sigprocmask resumed> NULL, 8) = 0 <0.000382>
[pid 29707] 11:18:26 <... rt_sigaction resumed> NULL, 8) = 0 <0.000592>
[pid 29706] 11:18:26 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], ~[ABRT KILL STOP], 8) = 0 <0.000016>
[pid 29707] 11:18:26 rt_sigaction(SIGINT, NULL,  <unfinished ...>
[pid 29706] 11:18:26 getpid( <unfinished ...>
[pid 29707] 11:18:26 <... rt_sigaction resumed> {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fdd05217140}, 8) = 0 <0.000310>
[pid 29706] 11:18:26 <... getpid resumed> ) = 29706 <0.000578>
[pid 29706] 11:18:26 gettid()           = 29706 <0.000016>
[pid 29706] 11:18:26 tgkill(29706, 29706, SIGABRT) = 0 <0.000016>
[pid 29706] 11:18:26 rt_sigprocmask(SIG_SETMASK, ~[ABRT KILL STOP], NULL, 8) = 0 <0.000016>
[pid 29706] 11:18:26 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=29706, si_uid=1000} ---
[pid 29707] 11:18:26 rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f04ec057140}, NULL, 8) = 0 <0.000030>

[pid 29706] 11:18:26 +++ killed by SIGABRT (core dumped) +++

11:18:26 rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fdd05217140}, 8) = 0 <0.000022>
...
11:18:26 rt_sigaction(SIGRT_32, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f04ec057140}, NULL, 8) = 0 <0.000022>
11:18:26 dup2(5, 1)                     = 1 <0.000026>
11:18:26 dup2(3, 2)                     = 2 <0.000023>
11:18:26 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000021>
11:18:26 execve("/usr/local/sbin/dpkg-query", ["dpkg-query", "-L", "bash"], ["LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca"..., "HOSTTYPE=x86_64", "LESSCLOSE=/usr/bin/lesspipe %s %s", "LANG=en_GB.UTF-8", "USER=stuart", "PWD=/home/stuart", "HOME=/home/stuart", "NAME=MacPro", "SHELL=/bin/bash", "TERM=xterm-256color", "SHLVL=1", "LOGNAME=stuart", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA "..., "LESSOPEN=| /usr/bin/lesspipe %s", "_=/usr/bin/strace", "OLDPWD=/home/stuart/bash"]) = -1 ENOENT (No such file or directory) <0.000036>
11:18:26 execve("/usr/local/bin/dpkg-query", ["dpkg-query", "-L", "bash"], ["LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca"..., "HOSTTYPE=x86_64", "LESSCLOSE=/usr/bin/lesspipe %s %s", "LANG=en_GB.UTF-8", "USER=stuart", "PWD=/home/stuart", "HOME=/home/stuart", "NAME=MacPro", "SHELL=/bin/bash", "TERM=xterm-256color", "SHLVL=1", "LOGNAME=stuart", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA "..., "LESSOPEN=| /usr/bin/lesspipe %s", "_=/usr/bin/strace", "OLDPWD=/home/stuart/bash"]) = -1 ENOENT (No such file or directory) <0.000025>
11:18:26 execve("/usr/sbin/dpkg-query", ["dpkg-query", "-L", "bash"], ["LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca"..., "HOSTTYPE=x86_64", "LESSCLOSE=/usr/bin/lesspipe %s %s", "LANG=en_GB.UTF-8", "USER=stuart", "PWD=/home/stuart", "HOME=/home/stuart", "NAME=MacPro", "SHELL=/bin/bash", "TERM=xterm-256color", "SHLVL=1", "LOGNAME=stuart", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA "..., "LESSOPEN=| /usr/bin/lesspipe %s", "_=/usr/bin/strace", "OLDPWD=/home/stuart/bash"]) = -1 ENOENT (No such file or directory) <0.000058>
11:18:26 execve("/usr/bin/dpkg-query", ["dpkg-query", "-L", "bash"], ["LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca"..., "HOSTTYPE=x86_64", "LESSCLOSE=/usr/bin/lesspipe %s %s", "LANG=en_GB.UTF-8", "USER=stuart", "PWD=/home/stuart", "HOME=/home/stuart", "NAME=MacPro", "SHELL=/bin/bash", "TERM=xterm-256color", "SHLVL=1", "LOGNAME=stuart", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/NVIDIA "..., "LESSOPEN=| /usr/bin/lesspipe %s", "_=/usr/bin/strace", "OLDPWD=/home/stuart/bash"]) = 0 <0.001349>
11:18:26 brk(NULL)                      = 0x7fffc16f2000 <0.000014>
11:18:26 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000026>
11:18:26 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa790710000 <0.000038>
11:18:26 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000037>
11:18:26 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 <0.000224>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=3659174697257185, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=128, st_size=21447, st_atime=2017-10-29T11:06:20+0000.323984500, st_mtime=2017-10-29T11:06:20+0000.324516100, st_ctime=2017-10-29T11:06:20+0000.334001900}) = 0 <0.000026>
11:18:26 mmap(NULL, 21447, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa790713000 <0.000061>
11:18:26 close(3)                       = 0 <0.000022>
11:18:26 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) <0.000028>
11:18:26 openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 <0.000241>
11:18:26 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\22\2\0\0\0\0\0@\0\0\0\0\0\0\0\220\330\35\0\0\0\0\0\0\0\0\0@\0008\0\n\0@\0I\0H\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0000\2\0\0\0\0\0\0000\2\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0"..., 832) = 832 <0.000031>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=1970324836996738, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=3832, st_size=1960656, st_atime=2017-10-28T14:53:28+0100, st_mtime=2017-10-11T21:21:40+0100, st_ctime=2017-10-28T14:53:38+0100.698294300}) = 0 <0.000021>
11:18:26 mmap(NULL, 4061792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa790020000 <0.000068>
11:18:26 mprotect(0x7fa7901f6000, 2097152, PROT_NONE) = 0 <0.000023>
11:18:26 mmap(0x7fa7903f6000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d6000) = 0x7fa7903f6000 <0.000049>
11:18:26 mmap(0x7fa7903fc000, 14944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa7903fc000 <0.000031>
11:18:26 close(3)                       = 0 <0.000033>
11:18:26 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa790700000 <0.000026>
11:18:26 arch_prctl(ARCH_SET_FS, 0x7fa790700740) = 0 <0.000013>
11:18:26 mprotect(0x7fa7903f6000, 16384, PROT_READ) = 0 <0.000020>
11:18:26 mprotect(0x7fa790a22000, 8192, PROT_READ) = 0 <0.000019>
11:18:26 mprotect(0x7fa790627000, 4096, PROT_READ) = 0 <0.000018>
11:18:26 munmap(0x7fa790713000, 21447)  = 0 <0.000039>
11:18:26 brk(NULL)                      = 0x7fffc16f2000 <0.000014>
11:18:26 brk(0x7fffc1713000)            = 0x7fffc1713000 <0.000029>
11:18:26 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 <0.000183>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=4785074604092159, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=7080, st_size=3624336, st_atime=2017-10-29T10:06:46+0000.614865300, st_mtime=2017-10-29T10:06:59+0000.019886100, st_ctime=2017-10-29T10:06:59+0000.019886100}) = 0 <0.000020>
11:18:26 mmap(NULL, 3624336, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa78fcab000 <0.000068>
11:18:26 close(3)                       = 0 <0.000019>
11:18:26 ioctl(1, TCGETS, 0x7fffc8714d30) = -1 ENOTTY (Inappropriate ioctl for device) <0.000015>
11:18:26 fstat(1, {st_dev=makedev(0, 0), st_ino=22507, st_mode=S_IFIFO|0600, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2017-10-29T11:18:26+0000.440393500, st_mtime=2017-10-29T11:18:26+0000.440393500, st_ctime=2017-10-29T11:18:26+0000.440393500}) = 0 <0.000018>
11:18:26 umask(022)                     = 000 <0.000014>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/arch", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000133>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/status", O_RDONLY) = 3 <0.000135>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=3096224743835880, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=1152, st_size=588939, st_atime=2017-10-29T11:06:20+0000.351404900, st_mtime=2017-10-29T11:06:20+0000.354454000, st_ctime=2017-10-29T11:06:20+0000.368232700}) = 0 <0.000021>
11:18:26 mmap(NULL, 589824, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa790670000 <0.000028>
11:18:26 read(3, "Package: python-apt-common\nStatus: install ok installed\nPriority: optional\nSection: python\nInstalled-Size: 240\nMaintainer: Ubunt"..., 588939) = 588939 <0.000388>
11:18:26 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4 <0.000206>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=3377699720724535, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=2995, st_atime=2017-10-28T14:53:28+0100, st_mtime=2017-10-11T21:21:40+0100, st_ctime=2017-10-28T15:00:25+0100.451242000}) = 0 <0.000021>
11:18:26 read(4, "# Locale name alias data base.\n# Copyright (C) 1996-2017 Free Software Foundation, Inc.\n#\n# This program is free software; you c"..., 4096) = 2995 <0.000037>
11:18:26 read(4, "", 4096)              = 0 <0.000023>
11:18:26 close(4)                       = 0 <0.000027>
11:18:26 open("/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000025>
11:18:26 open("/usr/share/locale/en_GB.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000021>
11:18:26 open("/usr/share/locale/en_GB/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000022>
11:18:26 open("/usr/share/locale/en.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000021>
11:18:26 open("/usr/share/locale/en.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000020>
11:18:26 open("/usr/share/locale/en/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000021>
11:18:26 open("/usr/share/locale-langpack/en_GB.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000124>
11:18:26 open("/usr/share/locale-langpack/en_GB.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000112>
11:18:26 open("/usr/share/locale-langpack/en_GB/LC_MESSAGES/dpkg.mo", O_RDONLY) = 4 <0.000142>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=2814749767117197, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=16, st_size=4969, st_atime=2017-10-29T09:59:20+0000, st_mtime=2017-10-12T21:27:16+0100, st_ctime=2017-10-29T09:59:29+0000.707738600}) = 0 <0.000021>
11:18:26 mmap(NULL, 4969, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7fa790717000 <0.000038>
11:18:26 close(4)                       = 0 <0.000014>
11:18:26 open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000116>
11:18:26 open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000110>
11:18:26 open("/usr/share/locale-langpack/en/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory) <0.000117>
11:18:26 brk(0x7fffc1735000)            = 0x7fffc1735000 <0.000028>
11:18:26 brk(0x7fffc1757000)            = 0x7fffc1757000 <0.000043>
11:18:26 brk(0x7fffc1779000)            = 0x7fffc1779000 <0.000029>
11:18:26 brk(0x7fffc179b000)            = 0x7fffc179b000 <0.000029>
11:18:26 brk(0x7fffc17c5000)            = 0x7fffc17c5000 <0.000028>
11:18:26 brk(0x7fffc17e7000)            = 0x7fffc17e7000 <0.000073>
11:18:26 brk(0x7fffc1808000)            = 0x7fffc1808000 <0.000030>
11:18:26 brk(0x7fffc182a000)            = 0x7fffc182a000 <0.000030>
11:18:26 brk(0x7fffc184c000)            = 0x7fffc184c000 <0.000028>
11:18:26 brk(0x7fffc186e000)            = 0x7fffc186e000 <0.000029>
11:18:26 brk(0x7fffc1890000)            = 0x7fffc1890000 <0.000028>
11:18:26 brk(0x7fffc18b2000)            = 0x7fffc18b2000 <0.000027>
11:18:26 close(3)                       = 0 <0.000055>
11:18:26 munmap(0x7fa790670000, 589824) = 0 <0.000068>
11:18:26 open("/var/lib/dpkg/updates/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 <0.000188>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=562949953469367, st_mode=S_IFDIR|0755, st_nlink=0, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=4096, st_atime=2016-09-13T21:45:09+0100, st_mtime=2017-10-29T11:06:20+0000.392042400, st_ctime=2017-10-29T11:06:20+0000.392042400}) = 0 <0.000021>
11:18:26 getdents(3, [{d_ino=562949953469367, d_off=24, d_reclen=24, d_name=".", d_type=DT_DIR}, {d_ino=562949953469367, d_off=24, d_reclen=24, d_name="..", d_type=DT_DIR}], 32768) = 48 <0.000026>
11:18:26 getdents(3, [], 32768)         = 0 <0.000014>
11:18:26 close(3)                       = 0 <0.000029>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/triggers/File", O_RDONLY) = 3 <0.000145>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=1970324837009548, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=1005, st_atime=2017-10-29T10:17:07+0000.340513900, st_mtime=2017-10-29T10:17:07+0000.340863500, st_ctime=2017-10-29T10:17:07+0000.349776100}) = 0 <0.000019>
11:18:26 read(3, "/usr/lib/mime/packages mime-support/noawait\n/usr/share/applications mime-support/noawait\n/usr/man man-db/noawait\n/usr/share/man "..., 4096) = 1005 <0.000035>
11:18:26 read(3, "", 4096)              = 0 <0.000023>
11:18:26 close(3)                       = 0 <0.000043>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/triggers/Unincorp", O_RDONLY) = 3 <0.000133>
11:18:26 fcntl(3, F_GETFD)              = 0 <0.000013>
11:18:26 fcntl(3, F_SETFD, FD_CLOEXEC)  = 0 <0.000014>
11:18:26 fstat(3, {st_dev=makedev(0, 2), st_ino=4785074604092314, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2017-10-29T10:20:31+0000.496540600, st_mtime=2017-10-29T10:20:31+0000.496540600, st_ctime=2017-10-29T10:20:31+0000.506122900}) = 0 <0.000020>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/info/format", O_RDONLY) = 4 <0.000138>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=562949953469823, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=2, st_atime=2016-09-13T21:41:19+0100, st_mtime=2016-09-13T21:41:19+0100, st_ctime=2016-09-13T21:41:19+0100}) = 0 <0.000020>
11:18:26 read(4, "1\n", 4096)           = 2 <0.000036>
11:18:26 close(4)                       = 0 <0.000027>
11:18:26 stat("/var/lib/dpkg/info/format-new", 0x7fffc8714bc0) = -1 ENOENT (No such file or directory) <0.000024>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/info/bash.list", O_RDONLY) = 4 <0.000141>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=1125899906890143, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=970, st_atime=2017-10-28T14:24:27+0100.619688600, st_mtime=2017-10-28T14:24:27+0100.620124500, st_ctime=2017-10-28T14:24:27+0100.628719400}) = 0 <0.000020>
11:18:26 read(4, "/.\n/bin\n/bin/bash\n/etc\n/etc/bash.bashrc\n/etc/skel\n/etc/skel/.bash_logout\n/etc/skel/.bashrc\n/etc/skel/.profile\n/usr\n/usr/bin\n/usr"..., 970) = 970 <0.000037>
11:18:26 close(4)                       = 0 <0.000027>
11:18:26 openat(AT_FDCWD, "/var/lib/dpkg/diversions", O_RDONLY) = 4 <0.000134>
11:18:26 fcntl(4, F_GETFD)              = 0 <0.000013>
11:18:26 fcntl(4, F_SETFD, FD_CLOEXEC)  = 0 <0.000013>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=4222124650777105, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=522, st_atime=2017-10-29T10:20:42+0000.966751500, st_mtime=2017-10-29T10:20:42+0000.967358300, st_ctime=2017-10-29T10:20:42+0000.976647600}) = 0 <0.000020>
11:18:26 fstat(4, {st_dev=makedev(0, 2), st_ino=4222124650777105, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=522, st_atime=2017-10-29T10:20:42+0000.966751500, st_mtime=2017-10-29T10:20:42+0000.967358300, st_ctime=2017-10-29T10:20:42+0000.976647600}) = 0 <0.000018>
11:18:26 read(4, "/usr/bin/pod2latex\n/usr/bin/pod2latex.bundled\nlibpod-latex-perl\n/usr/share/man/man1/pod2latex.1.gz\n/usr/share/man/man1/pod2latex"..., 4096) = 522 <0.000032>
11:18:26 read(4, "", 4096)              = 0 <0.000022>
11:18:26 write(1, "/.\n/bin\n/bin/bash\n/etc\n/etc/bash.bashrc\n/etc/skel\n/etc/skel/.bash_logout\n/etc/skel/.bashrc\n/etc/skel/.profile\n/usr\n/usr/bin\n/usr"..., 970) = -1 EPIPE (Broken pipe) <0.000019>
11:18:26 --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=29707, si_uid=1000} ---
11:18:26 +++ killed by SIGPIPE +++
Aborted (core dumped)

Running under gdb gives no output:

$ gdb ./bash_4.4-5ubuntu1_amd64/preinst
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bash_4.4-5ubuntu1_amd64/preinst...done.
(gdb) run
Starting program: /home/stuart/bash_4.4-5ubuntu1_amd64/preinst

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 34 (3 by maintainers)

Most upvoted comments

The CLONE_VFORK issue is described here. The crux of the CLONE_VM issue is that the building blocks of a process on Windows and Linux are different: on Windows you have a process object which amongst other things is a virtual memory container, and threads that run within this process. On Linux (*note some conjecture here as we can’t actually read the Linux source) there is a virtual memory object that can be assigned to processes. So on Linux, CLONE_VM makes a lot of sense: just reference the current VM object and assign it to the cloned process. On Windows however the VM object is the process, so what does it mean to share the VM space? Well, it means that you are running in the same process. So essentially what you get is a Windows thread. Conceptually this is pretty straight-forward, but all of our code was built around trying to map Linux process concepts to NT process concepts, and this did not fit into that model very well (two Linux processes mapping to one NT process). So @jstarks refactored a lot of code so that we ended up with a model where adding this additional capability was straight forward. We like to use equivalent Windows constructs whenever possible because it gives us for free all of the optimizations around scheduling, power, memory usage, etc.

Windows Insider Build 17046 has improved CLONE_VFORK and CLONE_VM support.

Unfortunately it didn’t make 17040. But the changes are staged for the next insiders build (along with some other good fixes).

You need to hold back bash

Yeah, no. It’s not just bash or ebtables, or any one particular package. The fix is to upgrade to build 17134, the latest and greatest stable version. As stated above, there is an issue with 16299 and below in support CLONE_VFORK and CLONE_VM. The upgrade does work in this build. That said, if upgrading Windows isn’t an option, Ubuntu 18.04 has it’s own image on the Microsoft Store for download.

This has the same underlying cause as #1878. This will be fixed in future insider build.