GNU Screen v5 hangs on tty disappearence with USB UART devices
GNU Screen, the application which is usually used as a terminal multiplexor, also supports serial devices and could be used with USB COM or USB UART converter cables.
Starting from the new major Screen v5 release, unplugging the USB UART cable results in screen process indefinitely hanging in the background and not releasing the /dev/ttyUSB[n] device.
Plugging the USB UART cable again results in new /dev/ttyUSB[n+1] device, which is inconvenient.
Investigating the issue
Screen used to work with USB UART cables for many years, that's why I first checked whether it's been updated recently by checking Fedora's dnf package manager history record.
And indeed, screen package has been updated several times according to the history records.
$ sudo dnf history list --contains-pkgs=screen ID Command line Date and time Action(s) Altered 481 dnf system-upgrade download --releasever=43 2025-10-29 17:25:43 8512 408 dnf system-upgrade download --releasever=42 2025-09-24 14:08:44 8509 335 dnf update --refresh 2025-07-20 13:37:02 194
The 481 is a Fedora 42→43 upgrade executed in the end of October 2025, where 408 is a Fedora 41→42 upgrade earlier in the September.
Note
To the reader unfamiliar with this distro release cycle, Fedora release is usually maintained for about 9 months only.
Screen did not work correctly for quite a while and I didn't spot the issue right away, puzzling myself as to why does the device ID changes almost all the time.
Let's check ID 335 update history:
$ sudo dnf history info 335 | grep ' screen' Upgrade screen-0:5.0.1-4.fc41.x86_64 User updates Replaced screen-0:4.9.1-2.fc41.x86_64 User @System
Screen has been updated from 4.9.1 to 5.0.1.
Triaging the issue
Let's start from downgrading the package to the v4 version.
This could be done by looking for the package in Koji build sytem:

Just grab the v4 version from f41 and install it with dnf install https://… manually.
It works!
All right, next step is running git bisect between the latest v4 tag and v5 tag version, and that brings us to a bit unexpected results:
The first bad commit is
commit c2d797a3792a6e9ee4276600cc00f22e121bc8e2 Author: Amadeusz Sławiński <amade@asmblr.net> Date: Mon Feb 3 23:38:48 2020 +0100 Fix 100% cpu use on one core with poll If there is no event timeout set just wait for 1 second instead of setting poll timeout to 0.
However reverting only it on the latest 5.0.1 version does nothing, the bug is not fixed.
Reverting works if I first checkout the commit which contain unrelated changes:
commit 6501c377b2059310bbfdaf7b217d31717abf648b
Author: Alexander Naumov <alexander_naumov@opensuse.org>
Date: Sat Jul 27 12:00:26 2024 +0200
hardstatus: move 'the count of screen windows' from 'C' to 'O'
And then revert the offending commit on top of it.
It seems there's a race condition between SIGHUP and termination routine, which I could not thoroughly debug in ~2 hours.
Reporting the issue
I've reported all my findings to the GNU Savannah bug tracker: https://savannah.gnu.org/bugs/?67855
Timeline
- 22 Dec 2025: Bug is filled
- 3 Jan 2026: Contacted by Alex Naumov in private to provide more details
As of now, bug is not fixed.