Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak in devices via peers (and sk) #5

Open
stef opened this issue Jun 18, 2024 · 0 comments
Open

memory leak in devices via peers (and sk) #5

stef opened this issue Jun 18, 2024 · 0 comments

Comments

@stef
Copy link

stef commented Jun 18, 2024

making a simple example and running it with asan, i see that even though i free all sessions using Noise_XK_session_free() and then all devices using Noise_XK_device_free() some memory leaks that is allocated by noise-star, it seems the biggest culprit is the peers, but it also seems that the device serialization key (sk) is not freed in Noise_XK_device_free()

==13784==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 216 byte(s) in 9 object(s) allocated from:
    #0 0x55ce3d2ff9cf in __interceptor_malloc (src/test+0xbc9cf) (BuildId: cfcdfcff81501c2bb9e6d42569c83ce41bc5e6ea)
    #1 0x7fa80bcd32a2 in Noise_XK_device_add_peer src/XK.c:907

Direct leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x55ce3d2ff3a7 in __interceptor_calloc (src/test+0xbc3a7) (BuildId: cfcdfcff81501c2bb9e6d42569c83ce41bc5e6ea)
    #1 0x7fa80bcd2c1f in Noise_XK_device_create src/XK.c:429
    #2 0x55ce3d24c835 in main src/test.c:705
    #3 0x7fa80ba0e6c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 288 byte(s) in 9 object(s) allocated from:
    #0 0x55ce3d2ff3a7 in __interceptor_calloc (src/test+0xbc3a7) (BuildId: cfcdfcff81501c2bb9e6d42569c83ce41bc5e6ea)
    #1 0x7fa80bcd323f in Noise_XK_device_add_peer src/XK.c:854

Indirect leak of 108 byte(s) in 9 object(s) allocated from:
    #0 0x55ce3d2ff3a7 in __interceptor_calloc (src/test+0xbc3a7) (BuildId: cfcdfcff81501c2bb9e6d42569c83ce41bc5e6ea)
    #1 0x7fa80bcd334c in Noise_XK_device_add_peer src/XK.c:880

Indirect leak of 72 byte(s) in 9 object(s) allocated from:
    #0 0x55ce3d2ff9cf in __interceptor_malloc (src/test+0xbc9cf) (BuildId: cfcdfcff81501c2bb9e6d42569c83ce41bc5e6ea)
    #1 0x7fa80bcd3292 in Noise_XK_device_add_peer src/XK.c:902
@stef stef changed the title memory leak in via peers in devices? memory leak in devices via peers (and sk) Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant