delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/01/16/23:08:15

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Message-ID: <18c301c19f0c$7176a770$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin-developers AT cygwin DOT com>
Subject: tty and the cygwin server
Date: Thu, 17 Jan 2002 15:07:12 +1100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-OriginalArrivalTime: 17 Jan 2002 04:08:10.0512 (UTC) FILETIME=[93705100:01C19F0C]

Ok, looking at the problem Gary reported, I've realised I don't
understand tty's :].

So I'm asking for a quick lesson.

To save anyone looking at the code, here's the key differences between
MAIN and cygwin_daemon.
<http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler
_tty.cc.diff?r2=1.50&r1=1.49.2.4&cvsroot=src&f=h>

in fhandler_tty_slave::open,
MAIN uses a single temp handle variable in the duplicate calls ,
cygwin_daemon always uses two.

MAIN always does the duplication internally, cygwin_daemon only does it
internally if the cygserver call fails.

I can't see any substantial differences other than that.

Yet...
running the daemon, rxvt quits after the first command is given to ash.
Without running the daemon, rxvt operates fine.

My question is, what occurs between accept_input and
process_slave_output in rxvt that could result in ash (the slave)
quitting? I can't get a strace of the slaves behaviour so far, which is
why I'm turning for inspiration here...

This is a strace snippet from a failed run
 1482 5445896 [main] rxvt 3660 fhandler_pty_master::accept_input: about
to write 3 chars t
o slave
12959 5458855 [main] rxvt 3660
fhandler_pty_master::process_slave_output: bytes read 1
 1025 5459880 [main] rxvt 3660
fhandler_pty_master::process_slave_output: returning 2
 1687 5461567 [main] rxvt 3660 fhandler_pty_master::hit_eof: all other
handles closed
 1949 5463516 [main] rxvt 3660 fhandler_pty_master::hit_eof: all other
handles closed
 1024 5464540 [main] rxvt 3660
fhandler_pty_master::process_slave_output: returning 0
 5284 5469824 [select_pipe] rxvt 3660 fhandler_pty_master::hit_eof: all
other handles clos
ed
 6412 5476236 [main] rxvt 3660 fhandler_pty_master::hit_eof: all other
handles closed
 1886 5478122 [main] rxvt 3660 fhandler_pty_master::hit_eof: all other
handles closed
 1068 5479190 [main] rxvt 3660
fhandler_pty_master::process_slave_output: returning 0
10435 5489625 [select_pipe] rxvt 3660 fhandler_pty_master::hit_eof: all
other handles clos
ed
11509 5501134 [main] rxvt 3660 fhandler_tty_common::close: no more
masters left. sending E
OF
 1629 5502763 [main] rxvt 3660 fhandler_tty_common::close: tty0
<0x728,0x750> closed
 1078 5503841 [main] rxvt 3660 fhandler_pty_master::close: freeing tty0
(0)

And this is from a good run
 1720 3832826 [main] rxvt 1996 fhandler_pty_master::accept_input: about
to write 3 chars t
o slave
13517 3846343 [main] rxvt 1996
fhandler_pty_master::process_slave_output: bytes read 1
 1550 3847893 [main] rxvt 1996
fhandler_pty_master::process_slave_output: returning 2
122079 3969972 [main] rxvt 1996
fhandler_pty_master::process_slave_output: bytes read 257
 1418 3971390 [main] rxvt 1996
fhandler_pty_master::process_slave_output: returning 261


Rob

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019