cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: compile question Solaris 5.8, curl 7.15.4

From: Kevin Martin <kevintm_at_ameritech.net>
Date: Thu, 10 Aug 2006 08:53:09 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What I find interesting is that when I compile curl with:

gcc -g -O2 -o curl main.o hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o strtoofft.o timeval.o -L/usr/local/ssl/lib
../lib/.libs/libcurl.a -lssl -lcrypto -ldl -lsocket -lnsl -lz

I can run the resulting curl with no problem. But when i compile it with:

gcc -g -O2 -static -o curl main.o hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o strtoofft.o timeval.o dlstubs.o
- -L/usr/local/ssl/lib ../lib/.libs/libcurl.a -lssl -lcrypto -lsocket -lnsl -lz

then I get the segfault and the resulting output that you see. So I'm guessing it's something to do with the dlstubs stuff and the
static linking.

Kevin

Daniel Stenberg wrote:
> On Wed, 9 Aug 2006, Kevin Martin wrote:
>
>> Here's some gdb output. I'm not sure what I'm supposed to be looking
>> for or if there is more I should provide.
>>
>> ffbeede0 getaddrinfo+0x538(1a187c, 1a9cb8, 50, ffbeeec4, ffbeee40,
>> ffbeee40)
>> ffbeee60 Curl_getaddrinfo+0xc4(1bdb40, 1a9cb8, 50, ffbeeec8, 81010100,
>> 1b4d28)
>> ffbeef98 Curl_resolv+0x1d4(ffffffff, 1a9cb8, ffffffff, 0, 4, 0)
>
> This looks very wrong. Are you possibly somehow using a 64bit Solaris
> here and/or there could be a mix of 32/64 bit tools/libs?
>
> Curl_resolv() is a libcurl function that takes 4 arguments. The first
> being a struct pointer and the second a pointer to a host name. This
> trace above shows 6 arguments and only one of them looks like a valid
> pointer...
>
> Curl_getaddrinfo() also takes 4 arguments, where the three first are the
> same as Curl_resolv() got.
>
> getaddrinfo() is a system/lib call that takes 4 arguments, all of them
> being pointers.
>
> So that trace indeed puzzles me....
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE2zpFaXZlxDxYaM4RAs2MAJ9sXDANWGUlDSI+HWaDLERs3+EVPACfe4vg
bVA7i34dy512NdjtCmQDmKw=
=4Zg6
-----END PGP SIGNATURE-----
Received on 2006-08-10