Package: dash
Version: 0.5.8-2.1
Severity: grave
Justification: causes non-serious data loss

When executing a command that yields an "Exec format error", dash
tries to reexecute the command as a shell script. This gives completely
erratic behavior, with random files created, in particular breaking
Subversion. Data loss may be possible since random files are created.

For instance:

$ file tadd.exe
tadd.exe: PE32 executable (console) Intel 80386, for MS Windows
$ /bin/dash -c tadd.exe
./tadd.exe: 1: ./tadd.exe: MZ��¸@€º´: not found
./tadd.exe: 2: ./tadd.exe: : not found
./tadd.exe: 1: ./tadd.exe: @.bss €: not found
./tadd.exe: 1: ./tadd.exe: .textd*,: not found
./tadd.exe: 3: ./tadd.exe: JPL2@�.idata: not found
./tadd.exe: 3: ./tadd.exe: –u
                             : not found
./tadd.exe: 4: ./tadd.exe: ~@0�.CRT4�ˆ@0�.tls: not found
./tadd.exe: 5: ./tadd.exe: @B/81P: not found
./tadd.exe: 13: ./tadd.exe: Syntax error: Missing '}'

and the following file has been created:

-rw-r--r-- 1      0 2016-02-29 20:06:23 \220\324V\366

A strace output shows:

16487 execve("./tadd.exe", ["tadd.exe"], [/* 109 vars */]) = -1 ENOEXEC (Exec 
format error)
16487 execve("/bin/sh", ["/bin/sh", "./tadd.exe"], [/* 109 vars */]) = 0

With bash, I just get:

$ bash -c ./tadd.exe
bash: ./tadd.exe: cannot execute binary file: Exec format error

With ksh93, I just get:

$ ksh93 -c ./tadd.exe
ksh93: ./tadd.exe: cannot execute [Exec format error]

With mksh, I just get:

$ mksh -c ./tadd.exe
mksh: ./tadd.exe: not executable: magic 4D5A

With zsh, I just get:

$ zsh -c ./tadd.exe
zsh:1: exec format error: ./tadd.exe

Only dash has some nasty behavior!

Note: I got this problem after cross-compiling for Windows and running
"make check" but forgetting to add "LOG_COMPILER=wine".

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dash depends on:
ii  debianutils  4.7
ii  dpkg         1.18.4
ii  libc6        2.21-9

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true

Reply via email to