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: openssh-4.1p1-2/cygwin-1.5.18-1: write(2) misbehaving?


On Aug 17 18:22, Dave Kilzer wrote:
> On Wednesday, August 17, 2005 3:58 AM, Corinna Vinschen wrote:
> > ...this isn't.  Are you really sure?  If my fix is really helping, you
> > should really have seen this message.  Did you, by any chance, use
> your
> > patched ssh version, accidentally?  It would explain that ssh worked
> > but the message hasn't been printed.  Can you check again?
> 
> I checked twice again today that using the new-cygwin1.dll you provided
> does NOT output any annoying messages to console (and works), but that
> going back to the cygwin1-1.5.18-1.dll does NOT work.  I also made sure
> I was using ssh.exe from /usr/bin.

Too bad.

> Furthermore, I discovered today that using new-cygwin1.dll only works
> when using OpenSSH in non-verbose mode ("ssh hostname").  When I try
> using OpenSSH in verbose mode ("ssh -v hostname") with new-cygwin1.dll,
> it fails with a new error message "Bad packet length 0" [...]

Which is actually the same problem, just for reading.

> 1.5.17-1		Both ssh commands worked
> 1.5.18-1		NEITHER ssh command worked (BOTH "Write
> [...]
> (*) I still did NOT see any annoying console output here.
> 
> Looking at these results, a change between 1.5.17-1 and 1.5.18-1 looks
> like it may be the culprit.  Does this jibe with the changes you made
> for new-cygwin1.dll?

The only change which could explain *some* difference would be the one
which adds a missing initializing of a variable in sendmsg/sendto.
But this should cure a problem, not create a new one, obviously.

The problem is this:  The only reason to return 0 from write() on a
socket would be that the Winsock function WSASendTo returns with no
error, *and* with the length returned set to 0.  My patch to the DLL
I prepared for testing added just code to check for this condition.
If it happens, it should print the console message and set the return
value and errno to a sensible value.

Since returning sensible values and printing the console message are
inseparable, you must see the message if my patch actually changes
something.

> Between the annoying console output not appearing and the fact that one
> of the original ways I was able to fix this issue was to compile
> OpenSSH-4.1p1-2 with the "-DPACKET_DEBUG=1" cflag WITH NO CHANGES to
> packet.c (please reread my original message; the second way I fixed it
> was with a change to packet.c without that cflag), this problem smells a
> lot like a compiler bug.

What's very strange is that I'm unable to reproduce the problem.  I tried
on two different machines with two different OSes (XPSP2, 2K3SP1) and
neither ssh nor ssh -v, neither with 1.5.18 nor with the above mentioned
test DLL showed the problem you're reporting.

So I'm wondering if this has something to do with your test systems?
Are you running a specific firewall or virus scanner software?  Does
switching them off change the behaviour of ssh?

If not, I'm afraid we can solve this problem only if you build your own
Cygwin DLL and try to debug this problem locally using GDB.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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