bitcoinfuzz icon indicating copy to clipboard operation
bitcoinfuzz copied to clipboard

NBITCOIN & NLIGHTNING memory leaks

Open kuliq23 opened this issue 2 months ago • 1 comments

LSan reports leakage for both Nbitcoin and Nlightning module. It does not scale with the number of fuzzruns.

See here (Note that for running in the Docker, I edited the Dockerfile)

I suppose these have to do with the .NET runtime and show up because the process ends abruptly and .NET runtime does not have a chance to free them?

If so, I won't be able to avoid similar leaks in the original PR this was discovered due to.

Discovered in regard to: https://github.com/bitcoinfuzz/bitcoinfuzz/pull/287#discussion_r2416806563_

kuliq23 avatar Oct 15 '25 17:10 kuliq23

OpenSSL 3.6.0 1 Oct 2025 (Library: OpenSSL 3.6.0 1 Oct 2025)

These leaks appear to be coming from OpenSSL (libcrypto.so). Updating the library might help.

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x6474845667b3 in malloc (/home/ondrej/bitcoinfuzz/bitcoinfuzz+0x2e57b3) (BuildId: 293f26ae807fce3db777af8a1de629200015bf61)
    #1 0x79406da237c4 in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.3+0x2237c4) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade)
    #2 0x79406d9e4127  (/lib/x86_64-linux-gnu/libcrypto.so.3+0x1e4127) (BuildId: 0698e1ff610cb3c6993dccbd82c1281b1b4c5ade)

Originally posted by @erickcestari in https://github.com/bitcoinfuzz/bitcoinfuzz/issues/287#issuecomment-3412132691

brunoerg avatar Oct 16 '25 19:10 brunoerg