0

I'm using OpenSSL's EVP routine and can not eliminate all still reachable memory. The tutorial linked above leaks this much:

==30413== LEAK SUMMARY:
==30413==    definitely lost: 0 bytes in 0 blocks
==30413==    indirectly lost: 0 bytes in 0 blocks
==30413==      possibly lost: 0 bytes in 0 blocks
==30413==    still reachable: 2,200 bytes in 27 blocks
==30413==         suppressed: 0 bytes in 0 blocks

and with the addition of the answer here, I was able to get it down to:

==30437== LEAK SUMMARY:
==30437==    definitely lost: 0 bytes in 0 blocks
==30437==    indirectly lost: 0 bytes in 0 blocks
==30437==      possibly lost: 0 bytes in 0 blocks
==30437==    still reachable: 744 bytes in 13 blocks
==30437==         suppressed: 0 bytes in 0 blocks

Is it possible to eliminate these? Is it something I should even bother with?

I've seen conflicting answers on SO stating that "still reachable" memory is a memory leak and others saying it isn't, hence my confusion.

Chirality
  • 745
  • 8
  • 22
  • 1
    How about putting your function into a big for loop and checking whether the _leaked memory_ size is increasing? If not, then you can be close to sure, that it has to do with OpenSSL initialization. If so, then it's not a problem. Also, don't use deprecated `ERR_remove_state`, use `ERR_remove_thread_state` instead. – Leśny Rumcajs Mar 09 '16 at 07:07
  • How would I go about putting a for loop in my program that doesn't affect EVP? The entire program is solely the EVP routine. Changing `ERR_remove_state` to `ERR_remove_thread_state` made no difference in bytes still reachable. Added a for loop of the entire program, heap usage increased as expected, but still reachable bytes remained the same. – Chirality Mar 09 '16 at 16:20
  • @LeśnyRumcajs Forgot to include your name in the last comment. Any suggestions? – Chirality Mar 09 '16 at 18:36
  • How about using these suggestions? https://www.openssl.org/docs/faq.html#PROG13 – Leśny Rumcajs Mar 10 '16 at 07:48
  • @LeśnyRumcajs Just tried all of those but they made no difference (I'm already using most anyways). Still stuck at `still reachable: 744 bytes in 13 blocks`. – Chirality Mar 10 '16 at 15:21

0 Answers0