Request for help debugging screen problem

Shaddy Baddah helium@shaddybaddah.name
Fri Feb 5 15:08:00 GMT 2010


Hi,

On 5/02/2010 2:35 PM, Christopher Faylor wrote:
> On Fri, Feb 05, 2010 at 02:46:48PM +0100, Corinna Vinschen wrote:
>> On Feb  5 10:42, Shaddy Baddah wrote:
>>> I'm trying to debug a problem with screen, rather than publish a bug
>>> report. I can do that as well if someone requests it, no problem.
<snip>
>>> Any help would be greatly appreciated.
>>
>> Can yopu expolain this in more detail, please?  What error codes
>> are returned, and how do you trigger the effect?
>
> Also, unless you have CYGWIN=server set, this code should not be used
> by the pty handler so I don't know why you're looking here.

The answer to Corinna's question may answer that. The situation is that 
I cannot reattach to a screen session from when logged in via ssh  on a 
Vista or Windows 7 install(which has CYGWIN=server set, right? To be 
honest, I have lost track of my tinkering with involving cygserver 
(which wasn't setup when the problem initially presented)). The same 
sessions can be attached by the same user using a desktop mintty 
session. And in this particular case, the user is non-Administrator.

  The message gets clobbered by the screen clear, but if you use strace, 
the error message seen is:

   185   26254 [main] screen 4812 C:\software\cygwin\bin\screen.exe: *** 
fatal error - couldn't initialize fd 0 for /dev/tty2

The issue is almost definitely related to the privilege model on these 
OSes, as as I expected, XP doesn't present with the same problem. It 
also does not present if I ssh into the unlocked Administrator account. 
It of course does present if logged into a Administrators grouped user 
account other than the standard Administrator user.

The strace revealed that the int fhandler_tty_slave::open(int, mode_t) 
called was returning EACCES in this way:

    44   25864 [main] screen 4812 fhandler_tty_slave::open: cannot dup 
handles via server. using old method.
   116   25980 [main] screen 4812 fhandler_tty_slave::open: can't open 
tty (2) handle process 3748
    33   26013 [main] screen 4812 seterrno_from_win_error: 
/cygdrive/z/shaddybaddah.name-projects/cygwin-master.git/winsup/cygwin/fhandler_tty.cc:556 
windows error 5
    29   26042 [main] screen 4812 geterrno_from_win_error: windows error 
5 == errno 13
    27   26069 [main] screen 4812 __set_errno: void 
seterrno_from_win_error(const char*, int, DWORD):319 val 13
   185   26254 [main] screen 4812 C:\software\cygwin\bin\screen.exe: *** 
fatal error - couldn't initialize fd 0 for /dev/tty2

I was hoping to detect what the differences in privileges/tokens??? 
between the regular desktop sesssion, and the ssh session are. In that 
way, I was hoping to understand why ReadFile was denying access, and see 
if I could tweak some of the named pipe creation flags. This is all very 
uninformed, but I was hoping to learn along the way.

I can attach the strace log on request.

Thanks in advance,
Shaddy



More information about the Cygwin-developers mailing list