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

memleaks on error from CLI #343

Open
cgwalters opened this issue Sep 12, 2024 · 1 comment
Open

memleaks on error from CLI #343

cgwalters opened this issue Sep 12, 2024 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@cgwalters
Copy link
Contributor

So today our error paths for executing the CLI in "should fail" cases just check that the binary exits with an error...

But we have memory leaks in some error paths it seems

Indirect leak of 4071 byte(s) in 1 object(s) allocated from:
    #0 0x7f67984f1aa0 in strdup (/lib64/libasan.so.8+0xf1aa0) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)
    #1 0x7f6798b73fe0 in lcfs_node_set_payload ../libcomposefs/lcfs-writer.c:920
    #2 0x7f6798b74328 in lcfs_node_set_symlink_payload ../libcomposefs/lcfs-writer.c:943
    #3 0x408609 in tree_from_dump_line ../tools/mkcomposefs.c:550
    #4 0x40998f in tree_from_dump ../tools/mkcomposefs.c:692
    #5 0x410165 in main ../tools/mkcomposefs.c:1696
    #6 0x7f679823d087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 4a92fcedbba6d6d2629ce066a2970017faa9995e)
    #7 0x7f679823d14a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x2a14a) (BuildId: 4a92fcedbba6d6d2629ce066a2970017faa9995e)
    #8 0x403744 in _start (/var/home/walters/src/github/containers/composefs/target/tools/mkcomposefs+0x403744) (BuildId: a27689977e2ea2fbdfc0379750b22f16b6276e69)

From 5 seconds of investigation I think this is us just using lcfs_node_unref() and not lcfs_node_destroy() (which isn't public API) in the mkcomposefs.c.

@cgwalters cgwalters added bug Something isn't working good first issue Good for newcomers labels Sep 12, 2024
@jeckersb jeckersb self-assigned this Sep 13, 2024
@jeckersb
Copy link
Collaborator

I'll take a look at this. I started reading through and digesting the libcomposefs internals yesterday, makes me miss the rust docgen even if just to look at function signatures and type definitions in one easily searchable place 🦀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants