This is the mail archive of the cygwin-developers 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: Request for help debugging screen problem


Hi Chris,

On 5/02/2010 3:34 PM, Christopher Faylor wrote:
On Fri, Feb 05, 2010 at 03:08:43PM +0000, Shaddy Baddah wrote:
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.

Not yet. Since this is cygwin-developers, not cygwin, the next step, given that we're theorizing a problem with cygserver, would be to rebuild the dll with the call to cygserver commented out to see if that fixes anything.

As I expected, it has not made a difference (I commented out the cygserver conditional, and left the block) . I expected this as I originally had exactly the same symptoms with cygserver running, and sans cygserver.


Regards,
Shaddy


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