Discussion:
libcurl with custom malloc and SSL
Ville Likitalo via curl-library
2021-05-25 09:25:08 UTC
Permalink
Hi,

I am trying out libcurl 7.64.0 (right now stuck with that version
for political reasons) with custom malloc implementation and SSL.

This was the result:

[Thread 0x7fffd3fff700 (LWP 147) exited]
*** Error in `/...': free(): invalid pointer:
0x00007ffff7eb8200 ***

Thread 1 "..." received signal SIGABRT, Aborted.
0x00007ffff4b3e420 in raise () from /lib64/libc.so.6
(gdb) backtrace
#0 0x00007ffff4b3e420 in raise () from /lib64/libc.so.6
#1 0x00007ffff4b3fa01 in abort () from /lib64/libc.so.6
#2 0x00007ffff4b81877 in __libc_message () from
/lib64/libc.so.6
#3 0x00007ffff4b88093 in malloc_printerr () from
/lib64/libc.so.6
#4 0x00007ffff4b89999 in _int_free () from /lib64/libc.so.6
#5 0x00007ffff69481be in OPENSSL_sk_free () from
/usr/lib64/libcrypto.so.1.1
#6 0x00007ffff65094fe in SSL_CTX_free () from
/usr/lib64/libssl.so.1.1
#7 0x00007ffff59f0448 in ?? () from /usr/lib64/libcurl.so.4
...
#13 0x00007ffff59c42a3 in curl_multi_perform () from
/usr/lib64/libcurl.so.4
#14 0x00007ffff59bad1b in curl_easy_perform () from
/usr/lib64/libcurl.so.4

The only interesting bit in the stack trace is that the pointer
which gets passed to libc free(void*) is one that has been
allocated with the private malloc libcurl has been set up with.

Now, I could not quickly find any existing open or closed bug
that would describe this but would this already be fixed in the
later versions?

- Ville Likitalo
--
"Lisäydinvoimaa tarvitaan EU:n tarpeisiin ei Suomen.
Suomessa tuotettu "halpa" sähkö myydään sähkömarkkinoilla
Saksaan ja muihin EU-maihin."

[***@iki.fi][+358-50-386 6269]
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
E
Daniel Stenberg via curl-library
2021-05-25 09:35:19 UTC
Permalink
Post by Ville Likitalo via curl-library
The only interesting bit in the stack trace is that the pointer
which gets passed to libc free(void*) is one that has been
allocated with the private malloc libcurl has been set up with.
Now, I could not quickly find any existing open or closed bug
that would describe this but would this already be fixed in the
later versions?
Without debug symbols nor any way to reproduce this problem, I don't think we
can tell for sure what the problem is or if it has been fixed already.
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-
Ville Likitalo via curl-library
2021-05-27 06:50:03 UTC
Permalink
Post by Daniel Stenberg via curl-library
Post by Ville Likitalo via curl-library
The only interesting bit in the stack trace is that the pointer
which gets passed to libc free(void*) is one that has been
allocated with the private malloc libcurl has been set up with.
Now, I could not quickly find any existing open or closed bug
that would describe this but would this already be fixed in the
later versions?
Without debug symbols nor any way to reproduce this problem, I don't think
we can tell for sure what the problem is or if it has been fixed already.
Hi,

I invested some time into building a test application for easier
debugging with all debug symbols. And managed to prove that the
code works, but reproduced the issue a bit later by a chance and
it was a build/linking related one instead.

- Ville Likitalo
--
"Nothing lasts forever but the certainty of change."

[***@iki.fi][+358-50-386 6269]
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.ht
Daniel Stenberg via curl-library
2021-05-27 07:10:07 UTC
Permalink
Post by Ville Likitalo via curl-library
it was a build/linking related one instead.
Great, glad you found it and that it wasn't a curl bug! =)
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Eti
Loading...