There is incorrect optimization in the code that relies on the fact that the TIOCMGET ioctl cannot get value 0 in the arg. It seems this may happen e.g. with the tty0tty null modem emulator, where the "arg == old_status" check is always true (because old_status is explicitly initialized to 0) causing statserial to loops even with the "-n" argument. I will PR workaround patch. Reproducible: Always Steps to Reproduce: 1. modprobe tty0tty 2. statserial -n /dev/tnt0 3. Actual Results: It loops until serial status is changed. Expected Results: It returns the status of the serial port. Incorrect code: unsigned int old_status = 0; /* value of previous call */ unsigned int arg; /* value returned by ioctl */ ... for (;;) { /* get modem status info */ status = ioctl(fd, TIOCMGET, &arg); ... /* avoid unneccessary screen updates */ if (arg == old_status) { sleep(1); continue; } old_status = arg; ... For "arg" being "0" we have the loop. Strace: openat(AT_FDCWD, "/dev/tnt1", O_RDONLY) = 3 ioctl(3, TIOCMGET, [0]) = 0 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 0x7ffc316de900) = 0 ioctl(3, TIOCMGET, [0]) = 0 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 0x7ffc316de900) = 0 ioctl(3, TIOCMGET, [0]) = 0 clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=1, tv_nsec=0}, 0x7ffc316de900) = 0 ...
https://src.fedoraproject.org/rpms/statserial/pull-request/1
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle. Changing version to 39.
This message is a reminder that Fedora Linux 39 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 39 on 2024-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '39'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 39 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 39 entered end-of-life (EOL) status on 2024-11-26. Fedora Linux 39 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.