[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
loadable sleep exits immediately
From: |
p . debruijn |
Subject: |
loadable sleep exits immediately |
Date: |
Tue, 12 Nov 2019 15:15:23 +0100 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: /opt/project/buildroot/output/host/bin/x86_64-buildroot-linux-gnu-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-buildroot-linux-gnu'
-DCONF_VENDOR='buildroot' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -D_FORTIFY_SOURCE=1
-Wno-parentheses -Wno-format-security
uname output: Linux netbootbox 4.14.153 #6 SMP Tue Nov 12 14:20:37 CET 2019
x86_64 GNU/Linux
Machine Type: x86_64-buildroot-linux-gnu
Bash Version: 4.4
Patch Level: 23
Release Status: release
Description:
The loadable sleep function seems to exit almost immediately
in some specific cases.
Repeat-By:
The following minimal reproducable example illustrates the issue:
#!/bin/bash
enable -f /lib/bash/sleep sleep
aaa ()
{
type sleep
while true; do
echo -n "A"
dmesg >/dev/null &
sleep $1
done
}
while true; do
aaa 5 &
sleep 60
done
Workaround:
Use /bin/sleep
However this is unwatend for long running scripts, where it pollutes
the process list.
- loadable sleep exits immediately,
p . debruijn <=