littlstar / request.cc

Simple HTTP request lib backed by libcurl, inspired by superagent.
10 stars 1 forks source link

investigate curl memory issues #6

Open stephenmathieson opened 9 years ago

stephenmathieson commented 9 years ago

idk if i'm doing something dumb, or if there's an issue with curl's ssl stuff:

$ make valgrind
valgrind --leak-check=full --error-exitcode=1 ./test
==16947== Memcheck, a memory error detector
==16947== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==16947== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==16947== Command: ./test
==16947== 
==16947== Conditional jump or move depends on uninitialised value(s)
==16947==    at 0x68901D5: gnutls_session_get_data (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.21.8)
==16947==    by 0x4E69125: ??? (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E6971D: ??? (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E69A24: Curl_gtls_connect (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E6A0B8: Curl_ssl_connect (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E43A1F: Curl_http_connect (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E545E9: Curl_protocol_connect (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E54899: Curl_setup_conn (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E54943: Curl_connect (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x4E5BBA0: ??? (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.2.0)
==16947==    by 0x404D9E: Request::End() (in /home/stephen/repos/github.com/littlstar/request.cc/test)
==16947==    by 0x40289D: TestGet() (in /home/stephen/repos/github.com/littlstar/request.cc/test)
==16947== 
==16947== 
==16947== HEAP SUMMARY:
==16947==     in use at exit: 3,952 bytes in 48 blocks
==16947==   total heap usage: 1,168,105 allocs, 1,168,057 frees, 63,695,209 bytes allocated
==16947== 
==16947== LEAK SUMMARY:
==16947==    definitely lost: 0 bytes in 0 blocks
==16947==    indirectly lost: 0 bytes in 0 blocks
==16947==      possibly lost: 0 bytes in 0 blocks
==16947==    still reachable: 3,952 bytes in 48 blocks
==16947==         suppressed: 0 bytes in 0 blocks
==16947== Reachable blocks (those to which a pointer was found) are not shown.
==16947== To see them, rerun with: --leak-check=full --show-reachable=yes
==16947== 
==16947== For counts of detected and suppressed errors, rerun with: -v
==16947== Use --track-origins=yes to see where uninitialised values come from
==16947== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 2 from 2)
make: *** [valgrind] Error 1
stephenmathieson commented 9 years ago

https://github.com/bagder/curl/issues/142