Sgementation fault introduced in 0.8.4 #2

Closed
opened 2024-01-24 12:00:25 +01:00 by mfd2007 · 1 comment
First-time contributor

I used the alpine docker container from bcliang/docker-libgourou. After the last changes in e05639c09d I get a segmentation fault, if I use acsm_downloader.

The reason is the new code

    long http_code = 400;
    curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code);

    if (http_code >= 400)
	EXCEPTION(gourou::CLIENT_HTTP_ERROR, "HTTP Error code " << http_code);

It is used after curl_easy_cleanup(curl); e05639c09d/utils/drmprocessorclientimpl.cpp (L301)

According to libcurl easy cleanup the curl-handle should not be used anymore.

Just moving the code above the call of curl_easy_cleanup(curl); solved the problem for me. This should be verified as I'm not that good in C++.

I used the alpine docker container from bcliang/docker-libgourou. After the last changes in e05639c09d7d5a0c26ee20857fef1d53bd0ca1cf I get a segmentation fault, if I use acsm_downloader. The reason is the new code ``` long http_code = 400; curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); if (http_code >= 400) EXCEPTION(gourou::CLIENT_HTTP_ERROR, "HTTP Error code " << http_code); ``` It is used after `curl_easy_cleanup(curl); ` https://forge.soutade.fr/soutade/libgourou/src/commit/e05639c09d7d5a0c26ee20857fef1d53bd0ca1cf/utils/drmprocessorclientimpl.cpp#L301 According to [libcurl easy cleanup](https://curl.se/libcurl/c/curl_easy_cleanup.html) the curl-handle should not be used anymore. Just moving the code above the call of `curl_easy_cleanup(curl);` solved the problem for me. This should be verified as I'm not that good in C++.
Owner

Thanks a lot. I did not noticed it in local !
Fixed in 0.8.5

Thanks a lot. I did not noticed it in local ! Fixed in 0.8.5
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: soutade/libgourou#2
No description provided.