Project

General

Profile

Actions

Bug #9042

closed

multiples of tty streams modules cause weirdness

Added by Rich Lowe over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2018-02-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

If libc believes itself to be in an xpg4 process, and it a pts device is opened, libc uses push_modules to push the tty streams modules.

In cases where a process doesn't expect this, this leaves you with multiples of the streams modules, like so:

; strconf
ttcompat
ldterm
ptem
ldterm
ptem
ttcompat
ldterm
ptem
pts

In this case, we are no longer able to get the terminal size information until modules are popped such that there is only one ptem on the stack.
Either the streams modules should not screw things if they're duplicated and stacked like this, or libc should be smart about not pushing them when they're already present. Or something.

See also #9041


Related issues

Related to illumos gate - Feature #9041: implement forkptyNew2018-02-05

Actions
Related to illumos gate - Bug #12306: XPG4v2 slave pty behaviour should generally be disabledClosedAndy Fiddaman

Actions
Actions #1

Updated by Rich Lowe over 3 years ago

Actions #3

Updated by Andy Fiddaman about 3 years ago

Testing proposed patch from above review link.

Using unpatched tmux compiled with gcc 7 and linked against xpg6-values.o.

Before:

bloody% strconf
ttcompat
ldterm
ptem
ldterm
ptem
ttcompat
ldterm
ptem
pts

After:

bloody% strconf
ttcompat
ldterm
ptem
pts
Actions #4

Updated by Electric Monk about 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 6cfa0a7079eb1baa0a742f1e4def7cdabc8dcdab

commit  6cfa0a7079eb1baa0a742f1e4def7cdabc8dcdab
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2018-06-04T08:34:36.000Z

    9042 multiples of tty streams modules cause weirdness
    Reviewed by: Randy Fishel <randyf@sibernet.com>
    Reviewed by: Carlos Neira <cneirabustos@gmail.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Actions #5

Updated by Fazal Majid over 2 years ago

I contributed a patch to OpenSSH upstream to work around this:
https://bugzilla.mindrot.org/show_bug.cgi?id=2945

Actions #6

Updated by Andy Fiddaman over 1 year ago

  • Related to Bug #12306: XPG4v2 slave pty behaviour should generally be disabled added
Actions

Also available in: Atom PDF