Skip to content

test-umount has started to fail under asan #8504

@evverx

Description

@evverx

Something that was merged recently seems to cause asan to report a memory leak:

$ git describe
v238-161-ged358dbd0

$ ./build/test-umount
...

=================================================================
==16164==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7ff801df4c40 in realloc (/lib64/libasan.so.4+0xdec40)
    #1 0x7ff800e6fd7c in _IO_vfscanf_internal (/lib64/libc.so.6+0x66d7c)
    #2 0x7ff800e82adc in _IO_vsscanf (/lib64/libc.so.6+0x79adc)

SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).

The backtrace isn't very useful. Probably the output of valgrind is more helpful:

==22905==
==22905== HEAP SUMMARY:
==22905==     in use at exit: 16 bytes in 1 blocks
==22905==   total heap usage: 1,488 allocs, 1,487 frees, 128,428 bytes allocated
==22905==
==22905== 16 bytes in 1 blocks are definitely lost in loss record 1 of 1
==22905==    at 0x4C31C15: realloc (vg_replace_malloc.c:785)
==22905==    by 0x55C5D7C: _IO_vfscanf (in /usr/lib64/libc-2.26.so)
==22905==    by 0x55D8ADC: vsscanf (in /usr/lib64/libc-2.26.so)
==22905==    by 0x55D25B3: sscanf (in /usr/lib64/libc-2.26.so)
==22905==    by 0x53236D0: mnt_table_parse_stream (in /usr/lib64/libmount.so.1.1.0)
==22905==    by 0x53249B6: mnt_table_parse_file (in /usr/lib64/libmount.so.1.1.0)
==22905==    by 0x10D171: swap_list_get (umount.c:194)
==22905==    by 0x10B06E: test_swap_list (test-umount.c:34)
==22905==    by 0x10B24B: main (test-umount.c:56)
==22905==
==22905== LEAK SUMMARY:
==22905==    definitely lost: 16 bytes in 1 blocks
==22905==    indirectly lost: 0 bytes in 0 blocks
==22905==      possibly lost: 0 bytes in 0 blocks
==22905==    still reachable: 0 bytes in 0 blocks
==22905==         suppressed: 0 bytes in 0 blocks
==22905==
==22905== For counts of detected and suppressed errors, rerun with: -v
==22905== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions