tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: hangup in close(2) after posix_openpt(3)



blymn@ wrote:

> On Sat, Oct 17, 2015 at 02:34:10AM +0900, Izumi Tsutsui wrote:
> > 
> > For application side, it looks the behavior (how unread data should be
> > handled on close(2)) is something like "implementation-defined."
> > 
> > I'll try to put some workaround into the application.
> > ("tcflush(s, TCIOFLUSH)" might work around)
> > 
> 
> That may or may not help.  There are some races in our pty code that can
> cause the flush to block forever.  I found this out when I was doing the
> libcurses test frame and also I think the same problem was experience
> with anita. [..]

Hmm.

Currently I'm working on updating pkgsrc/inputmethod/canna-canuum
and it also uses curses for input conversion status lines etc.

At first I met a hangup problem after exit(3) call.
Sometimes the canuum process (or shell forked from canuum)
stuck in lwp_park() after exit.

I thought "stall on close(2) issue reported by ruby-dev" was
the similar issue, but now it looks different issue.

I notice we can avoid the hangup in lwp_park() after exit(3)
by calling _exit(2) instead exit(3) in the parent canuum,
so I'll put it as a kludge for now.

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index