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,

On 7/02/2010 3:21 PM, Corinna Vinschen wrote:
On Feb 7 14:01, Shaddy Baddah wrote:
I'm sorry, I have abandoned inspect what the issue with cygserver is
because I've realised what the real situation is. int
fhandler_tty_slave::open (int, mode_t) needs to call OpenProcess
with PROCESS_DUP_HANDLE on the tty master process. When logged in
via ssh, this is the dedicated sshd process still owned by
cyg_server.

Huh? That's not how you explained the situation originally. IIUYC, the situation is that a desktop user created a screen session and then the same user trying to connect to the screen session from a ssh session gets a permission denied. In that case, the screen application is the pty master and when trying to connect from the ssh session, it has to open the screen process.

Yes, sorry about this. I intended to ammend the scenario in my last email and forgot to. I'm now at a very very confusing point in my analysis.


Before I begin, the situation I was faced with was that regardless of who created the screen session (inside ssh session or desktop), only the desktop user could reattach. I apologise if I didn't communicate that clearly.

However, I'm now all at sea. The very initial problem I faced is this. Anytime I try to perform a screen -r in a ssh session, I get no output and just get returned to the prompt:

shaddy@*** ~
$ (cd && exec screen)
[detached]

shaddy@*** ~
$ screen -r

shaddy@*** ~
$

So, I tried an strace:

shaddy@*** ~
$ strace -o /tmp/screen-r+cygserver-down.strace screen -r
27629 [main] screen 4940 C:\software\cygwin\bin\screen.exe: *** fatal error - couldn't initialize fd 0 for /dev/tty2


At this point, I assumed that by running strace, I was revealing the real reason I was being returned to a prompt without attaching to the screen session.

However, I now have a new problem. Say I have no screen sessions running at all:

shaddy@*** ~
$ screen -r
There is no screen to be resumed.

But I try an strace:

shaddy@*** ~
$ strace -o /tmp/screen-r+cygserver-down.strace screen -r
23025 [main] screen 5340 C:\software\cygwin\bin\screen.exe: *** fatal error - couldn't initialize fd 0 for /dev/tty2


I've completely lost faith in my strace scenarios now. This last scenario is how I came to determine that screen was trying to call OpenProcess() on the cyg_server owned sshd process. I was intending to mention it as it as it was unusual.

Why doesn't this last strace just output the same "There is no screen to be resumed." message? I am now hesistant to go on using strace, as I'm not sure it is helping me analyse my initial problem. It seems to be creating problems of its own???

Regards,
Shaddy


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