Bug 214611
Summary: | UM: stdout output ceases under certain conditions | ||
---|---|---|---|
Product: | Platform Specific/Hardware | Reporter: | development |
Component: | UML | Assignee: | Jeff Dike (jdike) |
Status: | CLOSED INVALID | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.10.x - 5.14.x | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
Init script to reproduce the bug
Debian UML kernel config UML config for 5.14.8 |
Description
development
2021-10-03 01:27:04 UTC
Created attachment 299065 [details]
Debian UML kernel config
Created attachment 299067 [details]
UML config for 5.14.8
(in case somebody stumbles across this, from my mailing list post) This really has nothing to do with UBD or something. What's happening is that you're using the command line badly. What do you expect this: ... < <(cat /dev/null) to do? What happens is that the shell creates a pipe. This pipe is connected on the one side to fd:1 in UML (stdin) and on the other to stdout of 'cat'. Now this is all fine, but 'cat' will *quit immediately* since it cannot read anything from /dev/null (it's write-only!). Therefore, the fd:1 in UML will be invalidated pretty much immediately, receiving EPOLLHUP. This is detected by the epoll code, raising an interrupt into the line level code, and the line code then closes the stdio console channel entirely, including stdout. If anything, the bug is that when you're not causing enough interrupts by using ubd, somehow this situation doesn't get detected, and the console remains open, so you still see the output... I think this might be if closing the FD didn't generate a SIGIO? In fact, if you generate SIGIO in *any* other way, including pressing enter while the script is running even if stdin is redirected from your dead cat [1], you still get the same behaviour of the channel getting closed. |