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: Curl coredump after re-use connection

From: Dan Fandrich via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 17 Sep 2019 08:55:59 +0200

On Tue, Sep 17, 2019 at 05:01:45AM +0000, Nguyen Hoang Tuan (Hubble Vietnam) via curl-library wrote:
> I am an newbie starting to use libcurl and trying to write an example to reuse
> http connection.
> Everything is ok when i just re call curl_easy_perform many times without any
> change.
> But when i try reuse connection from HTTP_POST to use in HTTP_GET, i got
> segmentation fault.
> The server address is same, just endpoint is difference.
>
> About the way I reuse connection, I just create a global variable 'curl', call
> easy init and passing it to post and get function.
>
> Libcurl version: 7.47.0

This version is over 3 years old. The first thing I'd suggest is trying a newer
version.

> I also got segmentation fault if i re-use the connection with difference server
> address.
>
> So what I should do and should not do when try to re-use connection ?

It should happen for the most part automatically. It's a common use case so I
would immediately suspect the application. Can you show us the code?
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-09-17