This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rxvt slow to get the prompt if another rxvt is already open on windows 7 64bit


2009/8/13 Corinna Vinschen:
> I just tried that on W7 and W7 64. ÂI can't reproduce any specific
> slowness starting with he second invocation of rxvt, incuding writing
> the utmp entry. ÂThe startup time is always the same, roughly a second,
> 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 = USER_PROCESS;
      ut.ut_pid = pid;
      ut.ut_time = time(0);
      char *dev = ptsname(fd);
      if (dev) {
        if (strncmp(dev, "/dev/", 5) == 0)
          dev += 5;
        strncpy(ut.ut_line, dev ?: "?", sizeof ut.ut_line);
        if (strncmp(dev, "pty", 3) == 0 || strncmp(dev, "tty", 3) == 0)
          dev += 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]