Minor memory leak due to channel not being closed
Created by: genodeftest
Steps to reproduce:
- build redoxfs with
cargo build
- run
$ valgrind --leak-check=full --vgdb=full schemes/redoxfs/target/debug/redoxfs-fuse build/userspace/filesystem.bin build/userspace/filesystem
What happens:
==15039== Memcheck, a memory error detector
==15039== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==15039== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==15039== Command: schemes/redoxfs/target/debug/redoxfs-fuse build/userspace/filesystem.bin build/userspace/filesystem
==15039==
redoxfs: opened filesystem build/userspace/filesystem.bin
==15039==
==15039== HEAP SUMMARY:
==15039== in use at exit: 26 bytes in 2 blocks
==15039== total heap usage: 16 allocs, 14 frees, 35,084 bytes allocated
==15039==
==15039== 26 (16 direct, 10 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==15039== at 0x4C2DADE: malloc (vg_replace_malloc.c:298)
==15039== by 0x4C2FC91: realloc (vg_replace_malloc.c:785)
==15039== by 0x4E5283F: fuse_opt_add_arg (fuse_opt.c:61)
==15039== by 0x4E52F67: add_arg (fuse_opt.c:114)
==15039== by 0x4E52F67: opt_parse (fuse_opt.c:374)
==15039== by 0x4E52F67: fuse_opt_parse (fuse_opt.c:414)
==15039== by 0x4E58D38: fuse_kern_mount (mount.c:588)
==15039== by 0x143C2C: fuse::channel::Channel::new::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hd991d380a692231b (channel.rs:85)
==15039== by 0x13C888: fuse::channel::with_fuse_args::h86d660b80b2a8622 (channel.rs:66)
==15039== by 0x143623: fuse::channel::Channel::new::_$u7b$$u7b$closure$u7d$$u7d$::h953967d5ac53bd71 (channel.rs:84)
==15039== by 0x134C41: _$LT$core..result..Result$LT$T$C$$u20$E$GT$$GT$::and_then::hb6320c7449f2ba88 (result.rs:601)
==15039== by 0x13CC0B: fuse::channel::Channel::new::h104f7eb0c1c40ef1 (channel.rs:83)
==15039== by 0x114CED: _$LT$fuse..session..Session$LT$FS$GT$$GT$::new::h866d4ed59279cc77 (session.rs:50)
==15039== by 0x11A4BC: fuse::mount::h11c4652a3452f21d (lib.rs:377)
==15039==
==15039== LEAK SUMMARY:
==15039== definitely lost: 16 bytes in 1 blocks
==15039== indirectly lost: 10 bytes in 1 blocks
==15039== possibly lost: 0 bytes in 0 blocks
==15039== still reachable: 0 bytes in 0 blocks
==15039== suppressed: 0 bytes in 0 blocks
==15039==
==15039== For counts of detected and suppressed errors, rerun with: -v
==15039== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Expected behavior: No memory lost on exit. The traceback looks like a channel is opened but not closed.