Bugs item #3404225, was opened at 2011-09-05 11:50
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3404225&group_id=976
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: crash
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: geneos (geneos)
Assigned to: Daniel Stenberg (bagder)
Summary: crash on linux 64 when dynamically linking at runtime
Initial Comment:
Hello,
ENV:
--------
Libcurl library seg faults when linked dynamically at runtime on linux 64. I am using libcurl.so with openssl, curl-7.20.0 (tried with curl-7.21.1, no luck). I am on a linux 64 bit machine.
uname -a:
Linux localhost.localdomain 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
curl -V:
curl 7.20.0 (x86_64-unknown-linux-gnu) libcurl/7.20.0 OpenSSL/0.9.8m zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL libz
openssl-0.9.8 version
PROBLEM:
-------------------
I want to dynamically load the curl library at runtime , For this, I use dlopen() and dlsym() calls. It loads the library fine, gets all the curl function handles properly, but crashes with "Segmentation fault" or "Illegal Instruction", as soon as I try to execute curl_easy_setopt using the handle. No matter what options I pass to this method. This problem does not occur if I try to link the library dynamically at compile time or if I run it on other platforms.
I have attached my code snippet.
I cannot link the library dynamically at compile time in my program. Your help will be highly appreciated.
----------------------------------------------------------------------
>Comment By: Daniel Stenberg (bagder)
Date: 2011-09-05 19:54
Message:
I don't understand how this is a bug of ours. We provide the code to a
library and it works great to link with and use on a bazillion platforms.
If you somehow cannot dlopen() it and use it, why is that a bug of ours? I
don't even understand how we even could work any differently depending on
how the function ends up in your program.
----------------------------------------------------------------------
Comment By: geneos (geneos)
Date: 2011-09-05 11:53
Message:
The compilation instructions for the test program is:
/usr/bin/g++ -DLINUX_64 -Wl,--hash-style=both -O2 -g
"-Wl,--wrap,__ctype_b,--wrap,__ctype_tolower" -Wno-system-headers
-I/home/user/Libs/curl/curl-7.20.0/include Libcurl_Test_Program.cpp
-L/home/user/openssl/lib -L. -lrt -lz -lssl -lcrypto
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3404225&group_id=976
Received on 2011-09-05