delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/13/15:24:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_73,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20090813143755.GA18635@calimero.vinschen.de>
References: <OFF8856A17 DOT 6A45AEC3-ONC1257610 DOT 003F1C23-C1257610 DOT 00410ECA AT bechtle DOT com> <416096c60908120535k26a6aed6t925eba2ce45e6dd7 AT mail DOT gmail DOT com> <20090813143755 DOT GA18635 AT calimero DOT vinschen DOT de>
Date: Thu, 13 Aug 2009 20:24:03 +0100
Message-ID: <416096c60908131224p87439c4k4dfd873f2b141eef@mail.gmail.com>
Subject: Re: rxvt slow to get the prompt if another rxvt is already open on windows 7 64bit
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

2009/8/13 Corinna Vinschen:
> I just tried that on W7 and W7 64. =C2=A0I can't reproduce any specific
> slowness starting with he second invocation of rxvt, incuding writing
> the utmp entry. =C2=A0The startup time is always the same, roughly a seco=
nd,
> regardless of the number of already open rxvt windows.

I tried it again briefly last night. It only happened when logged in
as an administrator, not as a limited user. That's with UAC enabled.
Didn't try disabling. Reproduced both with 'rxvt' and 'mintty -u', and
timed the delay to about 15 seconds.

Trying to investigate further now, I can no longer reproduce it.
That's without having changed anything, knowingly anyway. Gah.

This is on:
CYGWIN_NT-6.1-WOW64 Tobermory 1.7.0(0.212/5/3) 2009-08-11 11:07 i686 Cygwin

And here's the mintty code that (sometimes) triggers the problem:

      ut.ut_type =3D USER_PROCESS;
      ut.ut_pid =3D pid;
      ut.ut_time =3D time(0);
      char *dev =3D ptsname(fd);
      if (dev) {
        if (strncmp(dev, "/dev/", 5) =3D=3D 0)
          dev +=3D 5;
        strncpy(ut.ut_line, dev ?: "?", sizeof ut.ut_line);
        if (strncmp(dev, "pty", 3) =3D=3D 0 || strncmp(dev, "tty", 3) =3D=
=3D 0)
          dev +=3D 3;
        strncpy(ut.ut_id, dev ?: "?", sizeof ut.ut_id);
      }
      strncpy(ut.ut_user, (pw ? pw->pw_name : 0) ?: "?", sizeof ut.ut_user);
      login(&ut);

Must be the login() that does it. My uneducated guess is that it's
some sort of file access timeout regarding /var/run/utmp.

A couple of other things I noticed. When starting 'rxvt' or 'mintty
-u' as a limited user, no utmp entry is created, which seems to be due
to /var/run/utmp being owned by an administrator ("Fish"):

$ ls -l /var/run/utmp
-rw-r--r-- 1 Fish root 3080 Aug 13 19:56 /var/run/utmp

After deleting that file and touching it from the limited user account
("Andy"), both were able to create utmp entries:

$ w
 20:17:08 up 43 min,  3 users,  load average: 0.00, 0.00, 0.00
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
Fish     tty5      20:11   986days  0.00s  0.09s -bash
Fish     tty6      20:11   986days  0.00s  0.21s -bash
Andy     tty4      20:11   986days  0.00s  0.07s -bash

And of course I haven't been logged in for three years, so I guess the
IDLE field isn't implemented?

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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