cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 29 Dec 2010 00:50:15 +0100 (CET)

On Tue, 28 Dec 2010, S.Gopi wrote:

> I compiled libcurl with following support using Visual Studio 2008 in
> Windows 2003 R2 X64 Enterprise Edition
>
> libcurl = 7.21.3
> OpenSSL = 1.0.0c
> zlib = 1.2.5
> libssh2 = libssh2-1.2.8-20101221 (daily snapshot)

...

> In scp_recv function in ssh.c, libssh2_channel_read function is called which
> returns ERROR_EAGAIN which is stored in variable 'nread'. This variable
> nread is declared ssize_t (typedef __int64 for Windows 64 in
> config-win32.h).
> For reason which I don't know of, nread has an arbitrary current value of
> 4294967259 instead of expected -37 (ERROR_EAGAIN).

It looks like code in libssh2 has the -37 stored in a 32 bit unsigned value
and it expects it to be used fine by something that just converts it to a
signed 32 bit version. 4294967259-2^32 = -37.

win64 is a "funny" 64bit architecture and quite unlike all other 64bit
architectures so it unfortunately has its own set of quirks we need to hunt
down and fix.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-29