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.

curl_multi_cleanup(multiCurlPtr); in cpp 9.1 leads core dump

From: hotman eric via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 14 Jul 2020 17:46:09 +0800

hello:
  i use same code complied in g++7.1.0 it run well
but ,it occurs core dump with g++9.0,error message only core dump,
 volatile std::atomic<bool> needCancel;

 CURL *easyCurlPtr = curl_easy_init();

    CURLM *multiCurlPtr = curl_multi_init();
/*
set easyCurlPtr property,like url ,write_data,etc.
*/
   do
    {
        curl_multi_wait(multiCurlPtr, NULL, 0, 2000, NULL);
        curl_multi_perform(multiCurlPtr, &running_handlers);
    } while (running_handlers > 0 && !needCancel.load());
    int msgs_left = 0;
    CURLMsg *msg = NULL;

    while ((msg = curl_multi_info_read(multiCurlPtr, &msgs_left)) != NULL)
    {

        if (msg->msg == CURLMSG_DONE)
        {
            fillResponse(responsePtr, msg->easy_handle);
            curl_multi_remove_handle(multiCurlPtr, msg->easy_handle);
            curl_easy_cleanup(msg->easy_handle);
        }
    }
    curl_multi_cleanup(multiCurlPtr);<------core dump
________________________________________
when the code go into curl_multi_perform(multiCurlPtr, &running_handlers);
i set needCancel.store(true)
it gets core dump if complied with g++ 9.0,but,it run well with g++ 7.1

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-07-14