Dmitry
Dmitry

Reputation: 2887

Suppress potential memory leak in Valgrind

I'm getting the following logs from Valgrind:

MPK ==5263== 4 bytes in 1 blocks are still reachable in loss record 1 of 84
==5263==    at 0x402CE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==5263==    by 0x43D9F4B: ??? (in /lib/i386-linux-gnu/libcrypto.so.1.0.0)
==5263==    by 0x43DA5DB: CRYPTO_malloc (in /lib/i386-linux-gnu/libcrypto.so.1.0.0)
==5263==    by 0x44449A5: ??? (in /lib/i386-linux-gnu/libcrypto.so.1.0.0)
==5263==    by 0x44451EE: ENGINE_add (in /lib/i386-linux-gnu/libcrypto.so.1.0.0)
==5263==    by 0x444A776: ENGINE_load_dynamic (in /lib/i386-linux-gnu/libcrypto.so.1.0.0)

I'm quite sure that there is nothing wrong with my code or in libcurl, that uses libcrypto, so I want to suppress these messages.

From the documentation I could find any appropriate suppression type.

What should be written in the suppression file?

Upvotes: 3

Views: 1593

Answers (1)

John Bowers
John Bowers

Reputation: 1795

You can generate a suppression block by running the same command with --gen-suppressions=yes. This is the easiest way to figure out how to suppress a given error with valgrind. Just have it tell YOU what you should include as a suppression.

Once valgrind has generated the suppression, you can put it in a text file.

Run valgrind again specifying the suppression file with the --suppressions=<filename> argument, and viola your error/warning will be gone.

Upvotes: 5

Related Questions