Closed RuurdBeerstra closed 8 months ago
Thanks for pointing this out, we're testing your fix
Hi, thank you for the fix. However, on the very next line there is a similar issue, but there the logic is reversed:
904 curl_off_t speed; 905 #if LIBCURL_VERSION_NUM >= 0x073700 // 7.55.0 906 ret = curl_easy_getinfo(connectionHandle, CURLINFO_SPEED_DOWNLOAD_T, &speed); // throughput 907 #else 908 ret = curl_easy_getinfo(connectionHandle, CURLINFO_SPEED_DOWNLOAD, &speed); // throughput 909 #endif The CURLINFO_SPEED_DOWNLOAD (old) takes a pointer-to-double, the CURLINFO_SPEED_DOWNLOAD_T (new) takes a pointer to curl_off_t. That will not cause a floating point exception, but is is incorrect code. Version 7.55.0 is from August 2017, so it is unlikely that this will cause issues anywhere (and it works for us), but I had hoped this would have been spotted by a review on the fix...
And a co-worker just pointed out that the "curl_off_t speed" is also mis-used for CURLINFO_SPEED_UPLOAD_T vs. CURLINFO_SPEED_UPLOAD a few lines further down.
created another PR, take a look and approve if everything looks good to you
That seems like a proper solution. I think in this case a comment might be warranted to explain the slightly tricky definition of either a double or curl_off_t of 'metric', but I'll leave that up to you.
Thank you for the quick support!
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
During an an update of cURL code a type-error crept in near line 890. The new CURLINFO_APPCONNECT_TIME_T cURL api returns a curl_off_t, the code still uses a double. This causes a nasty floating point exception.
Expected Behavior
no crash.
Current Behavior
Crash.
Reproduction Steps
Build AWS core on Linux, run code that establishes an HTTP(s) session. Stack trace of an example crash (signal SIGFPE, floating point exception):
Possible Solution
We've patched the code as follows:
Additional Information/Context
The fix works.
AWS CPP SDK version used
1.11.277
Compiler and Version used
g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Operating System and version
Linux i-0ea8deb92c374.stable.infordev.local 5.10.209-198.858.amzn2.x86_64 #1