X works, but xterm doesn't stay open (solution/bug report)

Lafond, Kenneth G kenneth.g.lafond@intel.com
Mon Apr 28 17:45:00 GMT 2003

There is a limitation in Cygwin in for userIDs (although it may actually lie
within 'id'). I've found the issue. Here was the problem:

The Cygwin installer gave me a user ID of 190965 (in /etc/passwd).  That's
10000 more than in my SID.  The group also got 10000 added to it, so I'm
assuming this is a magic number indicating a domain account (which I have -
a LARGE domain).  Whenever I tried to log in, I'd always get the error I
described below:
"id: cannot find name for user ID 59893" and " I have no name!@<mycomputer>
$ "
I didn't know where the 59893 was coming from.  After much messing around I
noticed that the number in the error tracker the userID.  I finally decided
to change my userID to 1 in /etc/passwd to see what number I got back from
'id' - and the whole thing JUST WORKED.  

I was suprised, so I did some testing to make sure it works, and then did a
little math:

My ID was 190956, minus the error given 59893 gives:
19065-59893 = 131072.

>From the ntsec discussion on the web, 
"If another user (or a Windows group, treated as a user) is not present in
/etc/passwd, the user id of that user will have a special value of -1 (which
would be shown by ls as 65535)." 
I knew the point at which a positive number becomes negative (ie Cygwin uses
a SIGNED SHORT for the userID) it's at 65535.  Add one to 65535 because 0 is
one of the integers.
Well, guess what:
65536*2 = 131072.

That matches the number above and finds the relationship and discrepency
between the 'id' error and my user ID.  Changing the user ID to 1 made it
smaller than the critical wrapping number and so it works.  It works with
any ID between 1 and 65534 (65535 is the ?????? user per the ntsec docs, and
65536 starts this wrapping bug giving an error of not being able to find
user 0).

Wrapping issues are not uncommon - rsync and pop3 had the same problem about
a year or two ago.

Suggestion: Extend the userID field to be a signed INT instead of a SHORT.
That'll give 2147483648 users before we run into problems.  If the issue is
with 'id' then maybe someone can tell me who to talk to to fix it?

Kenneth G Lafond
System Validation Group
Validation Lead
Intel Corporation

-----Original Message-----
From: Lafond, Kenneth G 
Sent: Monday, April 28, 2003 10:06 AM
To: cygwin-xfree@cygwin.com
Subject: RE: X works, but xterm doesn't stay open

I think I found part of the bug.  Does anyone know the maximum number of
users (ie the highest UID) Cygwin can handle before 'wrapping', specifically
in a domain environment?


-----Original Message-----
From: Lafond, Kenneth G 
Sent: Friday, April 25, 2003 3:06 PM
To: cygwin-xfree@cygwin.com
Subject: X works, but xterm doesn't stay open

> Hey all -
> 	I'm new to Cygwin.  I've searched the web for two days, and have
gone through the archives and FAQ without finding the answer to my issue.
> 	I have the latest Cygwin 1.3.22-1, running on Windows 2000 Sp2.
I've installed all default items as well as a few others (like vim) and the
full XFree subcategory.  This is a fresh install.
> 	The symptoms:  The bash shell when launched form the desktop icon
works fine (mostly).  It does say that "id: cannot find name for user ID
59893" and " I have no name!@<mycomputer> $ ".  I don't know if this is a
problem for xterm, since I've seen rumblings of a user/SID problem in the
lists that's supposed to be fixed by a later release (which I have the
latest), so I *guessing* that this is not an issue. (although if you know
how to fix it, please let me know)
> 	I used the default startxwin.bat to start X, and it came up and
initialized twm and I got the outline for xterm, but when I placed the
window it disappeared.  I started xterm again from within twm with the same
result.  I set the DISPLAY variable from the bash shell (launched from
windows) and tried again with the same result.
> 	So, I changed the startxwin.bat to start wmaker instead.  I got the
same result with the xterm (opens and immediately closes).  I'm able to run
the calculator and prefrences windows in wmaker just fine, but xterm will
not stay open from X or from the windows bash shell (making this slightly
different symptoms than I've seen already in the list archives).
> 	There are no error messages or error files for me to analyze (that I
can find anyway).  Any idea what's going on?  I've posted the Xwinrl.log and
the setup.log below.
> Kenneth G Lafond
> System Validation Group

More information about the Cygwin-xfree mailing list