Open McDutchie opened 1 year ago
I have seen this before on various systems, especially slow ones, or Linux with musl libc.
There seems to be a race condition in job notifications (like Stopped or Suspended) that causes them to not always be printed before the next prompt as expected. Pressing return to get another prompt will cause them to be printed in that case.
I can reproduce this quite easily on Alpine Linux arm64 (which uses musl libc):
$ echo ${.sh.version}; uname -a
Version AJM 93u+m/1.0.5 2023-06-07
Linux bergzicht.inlv.org 6.1.30-0-virt #1-Alpine SMP Fri, 26 May 2023 06:53:59 +0000 aarch64 GNU/Linux
$ sleep 60 &
[1] 23620
$ kill -s TSTP $!
[1] + Stopped sleep 60 &
$ sleep 60 &
[2] 23621
$ kill -s TSTP $!
[2] + Stopped sleep 60 &
$ sleep 60 &
[3] 23622
$ kill -s TSTP $!
$ # no Stopped prompt displayed here, pressing Return will show it
[3] + Stopped sleep 60 &
$ sleep 60 &
[4] 23623
$ kill -s TSTP $!
$ # and again
[4] + Stopped sleep 60 &
$ sleep 60 &
[5] 23624
$ kill -s TSTP $!
[5] + Stopped sleep 60 &
$ sleep 60 &
[6] 23625
$ kill -s TSTP $!
[6] + Stopped sleep 60 &
$ sleep 60 &
[7] 23626
$ kill -s TSTP $!
$ # and again
[7] + Stopped sleep 60 &
$
Originally posted by @JohnoKing in https://github.com/ksh93/ksh/issues/653#issuecomment-1582808981
FWIW, I just got the test failure below (on Arch Linux):
I can only get this to happen while the CPU usage on all cores is around 100% during a heavy workload.