cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to debug a perl module using libcurl?

From: Cris Bailiff <c.bailiff_at_awayweb.com>
Date: Tue, 29 Jan 2002 10:19:59 +1100

Hi Georg,

I'm not sure which version of Curl::easy you are using, and you don't say if you
updated it or not for libcurl 7.9.3. Was this working with 7.9.2, then broke with
the same Curl::easy on 7.9.3?

Can you post a sample of your code? Ideally, you can remove all the non-libcurl
related code and simplify the libcurl calls down, then remove them one by one
until you have the smallest faulty program.

In terms of debugging, you can actually run perl under gdb and get a traceback,
especially if your libcurl is compiled with -g - try doing:

$ gdb perl mycrashingprog.pl

then, when gdb says the program crashed, do a stack backtrace:

gdb> bt

This will traceback though perl, the XS calling functions and the libcurl
routines themselves. This may give you a better idea of which options are giving
trouble.

(You can of course use the perl debugger, but only up to the point of
'curl_easy_perform', after which you don't see anything else at the perl level)

One 'bug' which bit recently (and is now noted in the Curl::easy pod information)
is that Curl::easy currently won't properly handle multiple curl handles with
callbacks - because of the static data in Curl::easy, later callbacks overwrite
earlier ones. I doubt this is the cause, as this is the same as it has been since
Curl::easy 1.2...

Cris

Georg Horn wrote:
>
> Howdy,
>
> just tried curl version 7.9.3, compiles and runs fine. Recompiled my perl
> interface, compiles and testscript runs fine. But my application, that uses the
> perl interface, crashes somewhere in Curl_easy_perform() and dumps core. Of
> cource, gdb shows nothing more than some silly adresses. Any idea, how i could
> trace this? I already switched CURLOPT_VERBOSE on, but it doesn't run so far,
> that it could print something.
>
> Bye,
> Georg
Received on 2002-01-29