Skip to content

pmem2: data_mover memory leak - pmem2_integration/TEST[39,41]: failed memcheck #5637

Closed
@grom72

Description

@grom72

ISSUE: pmem2: data_mover memory leak - pmem2_integration/TEST[39,41] failed under valgrind (self-hosted, rhel, RUNTESTS.py --force-enable memcheck)

Environment Information

  • PMDK package version(s): 37292d4
  • OS(es) version(s): Rocky Linux 9.1 (Blue Onyx)
  • ndctl version(s): 71.1
  • kernel version(s): 5.14.0-162.6.1.el9_1.x86_64
  • compiler, libraries, packaging and other related tools version(s):

Please provide a reproduction of the bug:

pmem2_integration/TEST39 failed under valgrind (self-hosted, rhel, RUNTESTS.py --force-enable memcheck)
wit error message:

HEAP SUMMARY:
==1218060==     in use at exit: 144 bytes in 2 blocks
==1218060==   total heap usage: 893 allocs, 891 frees, 2,882,026 bytes allocated
==1218060== 
==1218060== 144 (64 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2

fro page/byte configurations in all build types.

How often bug is revealed: (always, often, rare): always

Actual behavior:

pmem2_integration/TEST39: SETUP	(medium/debug/memcheck/cacheline)
Last 30 lines of /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/memcheck39.log below (whole file has 30 lines):
==1[2180](https://github.com/pmem/pmdk/actions/runs/4969298952/jobs/8892382286#step:6:2181)09== Memcheck, a memory error detector
==1218009== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==1218009== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==1218009== Command: /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/pmem2_integration test_map_from_existing /mnt/pmem0/pmem2_integration_39/testfile
==1218009== Parent PID: 1178863
==1218009== 
==1218009== 
==1218009== HEAP SUMMARY:
==1218009==     in use at exit: 144 bytes in 2 blocks
==1218009==   total heap usage: 898 allocs, 896 frees, 2,894,888 bytes allocated
==1218009== 
==1218009== 144 (64 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==1218009==    at 0x48447AB: malloc (vg_replace_malloc.c:393)
==1218009==    by 0x486AC19: _Malloc (alloc.c:72)
==1218009==    by 0x4865BAC: pmem2_malloc (pmem2_utils.c:21)
==1218009==    by 0x4861CDC: mover_new (mover.c:183)
==1218009==    by 0x485F1F0: pmem2_map_from_existing (map.c:274)
==1218009==    by 0x405731: test_map_from_existing (pmem2_integration.c:975)
==1218009==    by 0x4028E1: TEST_CASE_PROCESS (unittest.h:700)
==1218009==    by 0x405AE7: main (pmem2_integration.c:1030)
==1218009== 
==1218009== LEAK SUMMARY:
==1218009==    definitely lost: 64 bytes in 1 blocks
==1218009==    indirectly lost: 80 bytes in 1 blocks
==1218009==      possibly lost: 0 bytes in 0 blocks
==1218009==    still reachable: 0 bytes in 0 blocks
==1218009==         suppressed: 0 bytes in 0 blocks
==1218009== 
==1218009== For lists of detected and suppressed errors, rerun with: -s
==1218009== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Last 30 lines of /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/pmem2_39.log below (whole file has 36 lines):
<libpmem2>: <1> [out.c:230 out_init] compiled with support for Valgrind drd
<libpmem2>: <1> [out.c:235 out_init] compiled with support for shutdown state
<libpmem2>: <1> [out.c:240 out_init] compiled with libndctl 63+
<libpmem2>: <3> [libpmem2.c:29 libpmem2_init] 
<libpmem2>: <3> [init.c:558 pmem2_arch_init] 
<libpmem2>: <3> [init.c:472 pmem_cpuinfo_to_funcs] 
<libpmem2>: <3> [init.c:475 pmem_cpuinfo_to_funcs] clflush supported
<libpmem2>: <3> [init.c:527 pmem_cpuinfo_to_funcs] WC workaround = 1
<libpmem2>: <3> [init.c:272 use_avx_memcpy_memset] avx supported
<libpmem2>: <3> [init.c:280 use_avx_memcpy_memset] PMEM_AVX enabled
<libpmem2>: <3> [init.c:586 pmem2_arch_init] using clflush
<libpmem2>: <3> [init.c:595 pmem2_arch_init] using movnt AVX
<libpmem2>: <3> [source_posix.c:92 pmem2_source_size] type 2
<libpmem2>: <3> [map_posix.c:293 pmem2_map_new] cfg 0x52381d0 src 0x5238250 map_ptr 0x1ffeffed10
<libpmem2>: <3> [source_posix.c:143 pmem2_source_alignment] type 2
<libpmem2>: <3> [source_posix.c:92 pmem2_source_size] type 2
<libpmem2>: <3> [map_posix.c:477 pmem2_map_new] mapped at 0x5800000
<libpmem2>: <3> [auto_flush_linux.c:86 check_domain_in_region] region_path: /sys/bus/nd/devices/region0
<libpmem2>: <3> [auto_flush_linux.c:30 check_cpu_cache] domain_path: /sys/bus/nd/devices/region0/persistence_domain
<libpmem2>: <3> [map_posix.c:522 pmem2_map_new] using libpmem2 default async mover
<libpmem2>: <3> [mover.c:181 mover_new] map 0x54f4630, vdm 0x1ffeffec18
<libpmem2>: <3> [map.c:44 pmem2_map_get_size] map 0x54f4630
<libpmem2>: <3> [map.c:57 pmem2_map_get_store_granularity] map 0x54f4630
<libpmem2>: <3> [map_posix.c:580 pmem2_map_delete] map_ptr 0x1ffeffed50
<libpmem2>: <3> [mover.c:181 mover_new] map 0x54f48a0, vdm 0x54f4928
<libpmem2>: <3> [map.c:32 pmem2_map_get_address] map 0x54f48a0
<libpmem2>: <3> [map.c:44 pmem2_map_get_size] map 0x54f48a0
<libpmem2>: <3> [map.c:57 pmem2_map_get_store_granularity] map 0x54f48a0
<libpmem2>: <3> [map_posix.c:580 pmem2_map_delete] map_ptr 0x1ffeffed50
<libpmem2>: <3> [libpmem2.c:44 libpmem2_fini] 
Last 3 lines of /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/out39.log below (whole file has 3 lines):
pmem2_integration/TEST39: START: pmem2_integration
 /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/pmem2_integration test_map_from_existing /mnt/pmem0/pmem2_integration_39/testfile
pmem2_integration/TEST39: DONE
Last 0 lines of /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/err39.log below (whole file has 0 lines):
Last 3 lines of /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/trace39.log below (whole file has 3 lines):
{pmem2_integration.c:1029 main} pmem2_integration/TEST39: START: pmem2_integration
 /home/pmdkuser/actions-runner/_work/pmdk/pmdk/src/test/pmem2_integration/pmem2_integration test_map_from_existing /mnt/pmem0/pmem2_integration_39/testfile
{pmem2_integration.c:1031 main} pmem2_integration/TEST39: DONE
pmem2_integration/TEST39: FAILED	(medium/debug/memcheck/cacheline)

Expected behavior:

Details

Additional information about Priority and Help Requested:

Are you willing to submit a pull request with a proposed change? (Yes, No)

Requested priority: (Showstopper, High, Medium, Low)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions