Monitor mode handling (bug ?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Digging into a problem with a project of mine [1], I found dash (0.5.12) 
behaves differently from other POSIX-compliant shells when dealing with 
monitor mode when running in the background.

In the following example, dash immediately sends a SIGTTIN signal that stops 
the process group:

$ cat test.sh
set -m
$ dash test.sh &
[1]  + suspended (tty input)  dash test.sh

while other shells do not:

$ bash test.sh &
[1]  + done       bash test.sh
$ sh test.sh & # (/bin/sh from FreeBSD 13.1-RELEASE)
[1]  + done       sh test.sh
$ ksh93 test.sh &
[1]  + done       ksh93 test.sh

Is that an intended behaviour ?

Also, the following test leads to dash looping indefinitely and eating 100% 
CPU:

$ cat test2.sh
trap '' 21
set -m
$ dash test2.sh &

It remains stuck within the following loop:

https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/jobs.c?
h=v0.5.12#n208

Weird... Is that a dash bug or am I missing something?

Best regards,

Ganael.

[1] See https://github.com/martymac/fpart/issues/43 for more context

-- 
Ganael LAPLANCHE <ganael.laplanche@xxxxxxxxxxxx>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@xxxxxxxxxxx>, http://www.FreeBSD.org





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux