Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 689080

Summary: x11-terms/xterm-351: fails to start with 'open ttydev: I/O error' on musl-libc
Product: Gentoo Linux Reporter: Yed <yedvilun>
Component: HardenedAssignee: Gentoo musl team <musl>
Status: CONFIRMED ---    
Severity: major CC: aether, johannes.geiss, johu, wikky
Priority: Normal Keywords: NeedPatch, PullRequest
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/26523
Whiteboard:
Package list:
Runtime testing required: ---

Description Yed 2019-07-01 13:31:34 UTC
On a gentoo hardened musl new system, xterm fails to start.
There is a patch from alpine linux that fix the problem:

https://git.alpinelinux.org/aports/tree/community/xterm/posix-ptys.patch?h=3.10-stable
Comment 1 Max Tottenham 2020-05-03 22:46:27 UTC
Confirmed. I have been able to duplicate this issue. When started xterm produces:

open ttydev: I/O error
open ttydev: I/O error
open ttydev: I/O error
open ttydev: I/O error
....


With the applied patch xterm starts normally.
Comment 2 Michael 'veremitz' Everitt 2020-05-04 06:06:36 UTC
Verified same issue here also.

Patch fixes on -351 and -353.

@johu, do you might carrying patch in ::gentoo ? shouldn't affect glibc builds adversely.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-16 02:36:35 UTC
xterm-391 has:
```
+     * build-fix  for musl (report by Jonáš Vidra, adapted patch by Khem
+       Raj):
+          + modify  ifdef  for USE_OPENPTY, changing test for __GLIBC__ to
+            __linux__
+          + change ifdef's for _POSIX_SOURCE to _POSIX_VERSION
+          + modify  ifdef  for  setsid to use a configure-script check for
+            that  function's  existence  and  move  the old check to imake
+            fallbacks.

```

There may be more to do still though.
Comment 4 Larry the Git Cow gentoo-dev 2024-05-16 02:39:20 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93a38c258ec111a701892185761b860bc6d91abe

commit 93a38c258ec111a701892185761b860bc6d91abe
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-16 02:36:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-16 02:36:51 +0000

    x11-terms/xterm: add 391
    
    Bug: https://bugs.gentoo.org/689080
    Signed-off-by: Sam James <sam@gentoo.org>

 x11-terms/xterm/Manifest         |   2 +
 x11-terms/xterm/xterm-391.ebuild | 110 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+)
Comment 5 David Duchesne 2024-08-12 01:00:38 UTC
The old patch fails to apply with the latest stabilized version (393) but it doesn't matter as it is not needed anymore. xterm starts fine and the error "open ttydev: I/O error" is gone now. I tested on two different system with musl.
Comment 6 Vic Kerr (wikky) 2024-08-12 07:31:53 UTC
I can also confirm x11-terms/xterm-393 is working fine.