netcdf-c/ncgen
Dennis Heimbigner 751300ec59 Fix more memory leaks in netcdf-c library
This is a follow up to PR https://github.com/Unidata/netcdf-c/pull/1173

Sorry that it is so big, but leak suppression can be complex.

This PR fixes all remaining memory leaks -- as determined by
-fsanitize=address, and with the exceptions noted below.

Unfortunately. there remains a significant leak that I cannot
solve. It involves vlens, and it is unclear if the leak is
occurring in the netcdf-c library or the HDF5 library.

I have added a check_PROGRAM to the ncdump directory to show the
problem.  The program is called tst_vlen_demo.c To exercise it,
build the netcdf library with -fsanitize=address enabled. Then
go into ncdump and do a "make clean check".  This should build
tst_vlen_demo without actually executing it.  Then do the
command "./tst_vlen_demo" to see the output of the memory
checker.  Note the the lost malloc is deep in the HDF5 library
(in H5Tvlen.c).

I am temporarily working around this error in the following way.
1. I modified several test scripts to not execute known vlen tests
   that fail as described above.
2. Added an environment variable called NC_VLEN_NOTEST.
   If set, then those specific tests are suppressed.

This should mean that the --disable-utilities option to
./configure should not need to be set to get a memory leak clean
build.  This should allow for detection of any new leaks.

Note: I used an environment variable rather than a ./configure
option to control the vlen tests. This is because it is
temporary (I hope) and because it is a bit tricky for shell
scripts to access ./configure options.

Finally, as before, this only been tested with netcdf-4 and hdf5 support.
2018-11-15 10:00:38 -07:00
..
bindata.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
bytebuffer.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
bytebuffer.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
c0_4.cdl Tweaking cdl files so that we can compare against them. 2016-11-18 11:07:20 -07:00
c0.cdl Tweaking cdl files so that we can compare against them. 2016-11-18 11:07:20 -07:00
c5.cdl merge-squash 2015-10-09 10:12:11 -06:00
cdata.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
cdfdata.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
CMakeLists.txt Cmake 2017-06-06 16:21:04 -06:00
cmldata.c removed executable permissions from all code files 2011-10-04 16:05:11 +00:00
compound_datasize_test2.cdl support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
compound_datasize_test.cdl Reformated source cdl to allow for a diff test. 2016-11-16 10:57:36 -07:00
ctests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
cvt.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
data.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
data.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
debug.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
debug.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
depend moving to trunk subdir 2010-06-03 13:24:43 +00:00
dump.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
dump.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
env Use short "-k" codes instead of deprecated version numbers for ncgen and nccopy tests 2014-12-28 22:42:05 -07:00
escapes.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
f77data.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
foo.cdl Resolve Lynton's vlen problems (partially) re: jira NCF-145 2012-02-14 00:25:32 +00:00
ftests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
genbin.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genc.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genchar.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
gencml.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
generate.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
generr.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
generr.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genf77.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genj.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genjjni.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genjstd.c moving to trunk subdir 2010-06-03 13:24:43 +00:00
genlib.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
genlib.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
getfill.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
includes.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
internals.html Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
jdata.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
jdatajni.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
jdatastd.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
jtests.sh Use short "-k" codes instead of deprecated version numbers for ncgen and nccopy tests 2014-12-28 22:42:05 -07:00
lfs-tests Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
list.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
list.h Added MSVC-compatibility items. 2012-08-27 21:19:25 +00:00
main.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
Makefile.am merge master and resolve conflicts 2017-08-12 15:50:31 -06:00
makeparser.sh Swapped /bin/bash for /bin/sh to test on osx. 2018-08-12 23:01:08 -06:00
nc_iter.c Corrected a garbage-value error reported by Clang. 2013-11-22 13:48:30 -07:00
nc_iter.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
ncf199.cdl Updating ncgen run_nc4_tests.sh script to ensure that results are tested in addition to whether or not ncgen exited successfully. 2016-11-16 11:09:14 -07:00
ncf345.cdl Misc. source comment typos 2018-04-26 23:04:01 -04:00
ncgen.1 Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgen.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgen.l Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgen.y Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgenl.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgeny.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncgeny.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
odom.c Cleanup ncgen memory management 2017-10-30 15:52:08 -06:00
odom.h re: Jira NCF-309 2014-09-18 18:26:06 -06:00
ref_camrun.cdl Misc. source comment typos 2018-04-26 23:04:01 -04:00
run_tests2.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
semantics.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
tst_gattenum.cdl Apparently we have no .cdl test cases that have 2017-03-18 17:57:48 -06:00
tst_usuffix.cdl re: gihub issue https://github.com/Unidata/netcdf-c/issues/380 2017-03-24 18:56:14 -06:00
util.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
util.h Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
XGetopt.c Merge from latest netcdf-cmake branch. 2012-12-05 18:35:42 +00:00