DrylandEcology / SOILWAT2

An ecosystem water balance simulation model
GNU General Public License v3.0
5 stars 2 forks source link

Memory leak in nc-based test program #407

Closed dschlaep closed 3 months ago

dschlaep commented 4 months ago
make CPPFLAGS='-DSWNETCDF -DSWUDUNITS' CXX=clang++ test_sanitizer

(here clang version 18.1.6)

Direct leak of 128 byte(s) in 1 object(s) allocated from:

0 0x103a5e140 in malloc+0x6c (libclang_rt.asan_osx_dynamic.dylib:arm64+0x4e140)

1 0x1029e8240 in Mem_Malloc mymemory.c:85

2 0x1029e8308 in Mem_Calloc mymemory.c:107

3 0x102b1eb04 in SW_VPD_alloc_outptrs SW_VegProd.c:1026

4 0x1029cc9b0 in SW_CTL_alloc_outptrs SW_Control.c:394

5 0x10274297c in setup_testGlobalSoilwatTemplate() sw_testhelpers.cc:176

6 0x102740f1c in main sw_maintest.cc:47

7 0x184da3f24 ()

8 0x4738fffffffffffc ()

dschlaep commented 3 months ago

I still get the memory leak if I remove all "gtests/test_*" files.

dschlaep commented 3 months ago

I get the same memory leak with clang v16.0.6, v17.0.6, and v18.1.7