cURL / Mailing Lists / curl-library / Single Mail

curl-library

Solved: pycurl/libcurl/libfaketime crash in clock_gettime

From: Dima Tisnek <dimaqq_at_gmail.com>
Date: Tue, 10 Apr 2012 11:03:10 +0300

turns out libfaketime is responsible for the crash as opposed to
human-readable error or abort;
fundamental issue is that python dlopen()'s pycurl with RTLD_LOCAL
flag, thus real clock_gettime is unavailable.
Thus a workaround:
LD_PRELOAD="/path/to/libfaketime.so.1 /lib/librt.so.1" ./testcase.py

Happy testing, I know I will!

On 6 April 2012 12:13, Dima Tisnek <dimaqq_at_gmail.com> wrote:
> traced it down to this line in libfaketime (which is LD_PRELOAD'ed)
>
> real_clock_gettime = dlsym(RTLD_NEXT, "clock_gettime");
>
> somehow this dlsym call returns real pointer in command line
> curl/libcurl/libfaketime;
> and NULL in python/pycurl/libcurl/libfaketime.
>
> any idea what could be going on here?
> clearly this is not libcurl fault,
> perhaps pycurl or python has a role to play?
>
> d.
>
> On 4 April 2012 22:50, Dima Tisnek <dimaqq_at_gmail.com> wrote:
>> Right, will do this and get back soon.
>> d.
>>
>> On 4 April 2012 17:28, Daniel Stenberg <daniel_at_haxx.se> wrote:
>>> On Wed, 4 Apr 2012, Dima Tisnek wrote:
>>>
>>>> is fake time is used for testing libcurl and is known to work or is
>>>> broken? it's useful e.g. for testing certificate validity, accelerated
>>>> timeout tests, etc...
>>>
>>>
>>> I don't know. I had never even heard about it until your post just now...
>>>
>>>
>>>> any good pointers for debugging this?
>>>
>>>
>>> I'd suggest you rebuild libcurl with "configure --enable-debug" and then use
>>> a debugger to investigate the crash.
>>>
>>> Do you have a specific command line for us that repeats the problem?
>>>
>>> --
>>>
>>>  / daniel.haxx.se
>>> -------------------------------------------------------------------
>>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>>> Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-10