curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: core dump on curl function call

From: treesa fairy joseph via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 18 Oct 2021 12:06:46 +0530

My issue still there. I could not proceed much.

My code is for a https client that tries to connect with a https server.
It uses 2 functions, both of which are invoked using the same curl handle,
from the same thread.
The curl_easy_init is called initially, and the same curl handle is being
used for both the functions.
One function will be called to do the initial https connection to the URL
of the server. If the response is failure, the second function will be
called, which will send an empty http message to the server. This will
continue and the curl handle is not cleaned. Also both
the functions are in the same thread only.

Also in my client code, I don't have a connection which is always connected
to the server. If no need of any communication with the server, the client
thread will
terminate. Later, if it needs to connect with the server, again a new
thread will be created. The new thread also will have the same code as
mentioned above. But
all threads are using the same curl handle. Also there is a check that at
any time, there will only be a single https client thread, that connects
with the https server.

Also there is no cleaning of the curl handle. The same curl handle gets
used across all the https client thread. I guess this should be OK, as at
any time, there
will only be a single https client thread, connecting to the server.


One more point, the same code is being used to connect between a http
server and an http client also. I don't get a segfault in that scenario.
The main difference
in case of a https connection and http connection is that, in case of https
connection, the following curl API is used.
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L);
This API is not used in case of http connection between the client and the
server.

Could you provide any more help?


Thanks and Regards,
Treesa

On Mon, Oct 4, 2021 at 12:04 PM treesa fairy joseph <treesafj_at_gmail.com>
wrote:

> Thank you very much. Will check my code based on these inputs
>
> regards,
> Treesa
> ---------- Forwarded message ---------
> From: Daniel Stenberg <daniel_at_haxx.se>
> Date: Fri, Oct 1, 2021 at 8:29 PM
> Subject: Re: core dump on curl function call
> To: treesa fairy joseph <treesafj_at_gmail.com>
> Cc: treesa fairy joseph via curl-library <curl-library_at_lists.haxx.se>
>
>
> On Fri, 1 Oct 2021, treesa fairy joseph wrote:
>
> > #0 0x00000000005377c4 in Curl_hash_clean_with_criterium
> (h=0xffff7c0a4d50,
> > user=0xffff8b28d970,
> > comp=0x4ba604 <hostcache_timestamp_remove>) at hash.c:243
> > 243 hash.c: No such file or directory.
> > (gdb) bt
> > #0 0x00000000005377c4 in Curl_hash_clean_with_criterium
> (h=0xffff7c0a4d50,
> > user=0xffff8b28d970,
> > comp=0x4ba604 <hostcache_timestamp_remove>) at hash.c:243
>
> This issue shows the typical signs of a threading problem. Make sure that
> your application and threading follow the advice here:
>
> https://curl.se/libcurl/c/threadsafe.html
>
> In particular the dont-use-the-same-handle-twice rule.
>
> If that doesn't help, then I'd advice you to start trying to create a
> separate
> stand-alone example code that reproduces the problem that you can share
> with
> us.
>
> --
>
> / daniel.haxx.se
> | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> | https://curl.se/support.html
>


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-10-18