Bug 141150 - [pty] [hang] TIOCDRAIN ioctl on pts/pty master hangs
Summary: [pty] [hang] TIOCDRAIN ioctl on pts/pty master hangs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 22:50 UTC by John Hood
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hood 2009-12-03 22:50:01 UTC
our ancient 'gksu' port is broken-- it hangs after running the su/sudo command, and so output from the command never appears and gksu never exits.

the problem is twofold-- a bug in libgksu, which calls tcdrain() on the master side of a pty; and a bug in kernel, which hangs rather than returning an error on the tty ioctl.

see ports/141149 for a report + patch on libgksu.

I observe this on both 7.1 and 8.0.

8.0 kernel sleeps on ttyout when this happens.

In 8.0, ptsdev_ioctl() already seems to have some code to handle just this case, but it's only applied to the TIOCSETA[FW] ioctls used by tcsetattr().  So maybe it just needs to do this for TIOCFLUSH/TIOCDRAIN too.

In 7.1, something different happens, of course-- it looks like all these cases go through to the slave pty, and just TIOCSETA[FW] get a flush beforehand.

How-To-Repeat: sudo pkg_add -r gksu
gdb gksu id
^C
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:33 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped