The bug report describes an issue where `wait4` and `waitpid` return incorrect values when running a background job in a RISC-V 32-bit chroot environment under QEMU Linux-user emulation. This causes the shell to hang indefinitely. Key observations: 1. **Waitid Flood**: The strace output shows repeated calls to `waitid(P_ALL, -1, {}, WNOHANG|WEXITED|WSTOPPED|WCONTINUED, NULL) = 0`. This indicates that the process is continuously checking for child process status but not receiving any events. 2. **Infinite Hang**: When running a background job (e.g., `sleep 1000 &`), the shell hangs indefinitely instead of continuing to accept commands. 3. **Reproducer Code**: The provided `simple_shell.c` demonstrates that when launching a background process, the shell does not handle it correctly and enters an infinite loop while checking for completed jobs. 4. **QEMU Emulation Issue**: The problem is specific to QEMU's Linux-user mode emulation of RISC-V 32-bit systems. This issue appears to be related to how QEMU handles system calls like `waitid` in the RISC-V 32-bit environment, possibly leading to incorrect return values or not updating process states correctly. It affects runtime behavior by causing indefinite hangs when dealing with background processes. **Classification**: The problem is a **runtime** error because it occurs during the execution of the program and relates to how QEMU emulates system calls in this specific environment. runtime