[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems linking agains a shared library - maybe [OT] ?
- To: "Linux-IL mailing list" <linux-il(at-nospam)cs.huji.ac.il>
- Subject: Re: problems linking agains a shared library - maybe [OT] ?
- From: "Ermon (Eyal Sagi)" <security(at-nospam)magician.homeip.net>
- Date: Mon, 16 Jul 2001 20:55:45 +0200
- In-Reply-To: <019c01c10e24$b0690a50$2900000a@oded>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
Hi, Oded, and everyone else,
Some preliminary results (I have not yet found the exact problem within the
library) indicates that the problem is some sort of bad pointer reference
within the ferit library.
Basically the problem is that you used a static string as an argument, and
using a variable instead seems to work. I'll try and find the exact culprit
and report it, but a quick workaround is to use an intermediate variable.
BTW, I didn't try debugging the library directly, but I doubt that linking
is the cause of the problem.
-Eyal
At 08:24 PM 7/16/2001, Oded Arbel wrote:
>Hi list !
>
>I'm trying to use a file transfer library called libFerit
>(http://www.mindspring.com/~darkskye/projects/ferit.html). it has an obscure
>build process, which ends putting a .so file in /usr/lib and some header
>files in /usr/include/ferit.
>so I wrote this simple program to test the library :
>
>#include <ferit/Http.h>
>
> int main(int argc, char *argv[])
>{
> Http* http = new Http(10);
> //Url* url = new Url("http://www.cnn.com");
> Url* url = new Url("");
> url->UrlToSession("http://www.cnn.com");
> url->Options(OPT_PROGRESS | OPT_RESUME);
> url->Outfile("index.html");
> url->Print();
> if (http)
> printf("Error status %i\n", http->Download(url, NULL));
> else printf("Error !\n");
>
> return EXIT_SUCCESS;
>}
>
>compiled and linked it :
>gcc -o test main.cpp -lferit
>
>now, when I try to run it (from the command line) it segfaults immidietly.
>when run through gdb (with no break points) it segfaults in another place.
>when run through gdb with a break point somewhere at the start (stoping at
>the break point and then continue to the end), or using some gdb front end,
>it runs properly w/o a flaw. when I tried to trace it using KDevelops gdb
>front end (where I first encountered the problem) it crashes when doing
>'gethostbyname', but deep down in some obscure part of libc, where I see all
>kinds of functions on the stack that have names that start with _dl_.
>from all this I guess this is some sort of linking problem because of using
>a linking paradigm I'm not aware of.
>I've already emailed the author of the library, and he couldn't help me
>except offer some syntax corrections (the commented line was replaced by the
>two lines after it).
>
>the wierd thing is that the library comes with a program that links against
>it and used as a simple client. the simple test above is actually made up of
>selected code lines from this client programs main function. this client
>binary is also being built in a similar matter - but it always runs with no
>problems.
>
>I'm not sure what to do, since all the shared libraries I've built and used
>so far where using libtool which looks completly different..
>help ?
>
>Oded
>
>--
>There are three kinds of lies - lies, damn lies, and statistics.
>
>
>
>=================================================================
>To unsubscribe, send mail to linux-il-request@linux.org.il with
>the word "unsubscribe" in the message body, e.g., run the command
>echo unsubscribe | mail linux-il-request@linux.org.il
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il