Issue Title (Short summary)
[bug] UnixBench shell tests hanging
Environment
- Application / Service name: NA
- Version / Branch: mainline
- Deployment environment: qemu
- Container runtime (if any):
- Other dependencies (e.g., database, cache, middleware and versions): UnixBench 6.0.0, perl, make, gcc, g++
A configured image can be downloaded via rootfs-unixbench.img.xz
Architecture
aarch64 + qemu
Image (Container Image Information)
- Image registry and name: alpine-rootfs img
Description
When running the compiled Unixbench shell1/8/16 test on Starry OS, it froze after about 30 seconds.
Reproduction Steps (if reproducible)
cd ./UnixBench && ./Run shell1
Expected Behavior
The test continues and the test score will be displayed after approximately 180 seconds.
Actual Behavior
it would froze after about 30 seconds without any warnings or error. Meanwhile, this process can be killed throught the shortcut ''ctrl+c''.
Logs / Error Details
- System or container status:
Troubleshooting & Workarounds
The root cause of this issue is that the /bin/sh process running multi.sh, when waiting for the tst.sh child processes it spawned, suspends itself using sigsuspend—following POSIX conventions—until it receives a SIGCHLD from the kernel. However, in StarryOS’s previous implementation, sigsuspend returned 0 after being awakened by a signal instead of returning -EINTR as required by the specification.
As a result, /bin/sh mistakenly believed that it had not been interrupted by a signal and that the call returned normally. This broke the entire wait logic: the shell failed to retrieve the child process statuses in time, causing the outer multi.sh shell to block indefinitely, which ultimately led to the entire shell1 test hanging.
Notes / Additional Information
- Related Issue / PR / RFC links:
- Contact person (for follow-up questions):
- Desired priority (e.g., P0/P1/P2):
Issue Title (Short summary)
[bug] UnixBench shell tests hanging
Environment
A configured image can be downloaded via rootfs-unixbench.img.xz
Architecture
aarch64 + qemu
Image (Container Image Information)
Description
When running the compiled Unixbench shell1/8/16 test on Starry OS, it froze after about 30 seconds.
Reproduction Steps (if reproducible)
Expected Behavior
The test continues and the test score will be displayed after approximately 180 seconds.
Actual Behavior
it would froze after about 30 seconds without any warnings or error. Meanwhile, this process can be killed throught the shortcut ''ctrl+c''.
Logs / Error Details
Troubleshooting & Workarounds
The root cause of this issue is that the
/bin/shprocess runningmulti.sh, when waiting for thetst.shchild processes it spawned, suspends itself usingsigsuspend—following POSIX conventions—until it receives aSIGCHLDfrom the kernel. However, in StarryOS’s previous implementation,sigsuspendreturned0after being awakened by a signal instead of returning-EINTRas required by the specification.As a result,
/bin/shmistakenly believed that it had not been interrupted by a signal and that the call returned normally. This broke the entirewaitlogic: the shell failed to retrieve the child process statuses in time, causing the outermulti.shshell to block indefinitely, which ultimately led to the entireshell1test hanging.Notes / Additional Information