netcdf-c/include
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
..
.gitignore
ceconstraints.h
CMakeLists.txt re: github issues 2018-10-30 20:48:12 -06:00
err_macros.h getting parallel benchmarks to work, cleanup of benchmark scripts 2018-08-24 08:59:58 -06:00
fbits.h
hdf4dispatch.h add a missed update to NC_HDF4_open 2018-09-23 01:36:50 -05:00
hdf5internal.h changed header files to separate HDF5-specific grp info 2018-11-12 07:40:15 -07:00
Makefile.am re: github issues 2018-10-30 20:48:12 -06:00
nc3dispatch.h Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
nc3internal.h This Pre removed #include <netcdf.h> from netcdf_mem.h. 2018-10-07 12:05:26 -06:00
nc4dispatch.h Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
nc4internal.h rest of moving HDF5 specific group info to libhdf5 2018-11-12 14:04:17 -07:00
nc_hashmap.h
nc_logging.h only define nc_set_log_level() to nothing for netcdf-4 builds 2018-07-16 13:47:18 -06:00
nc_tests.h fixed many benchmark warnings 2018-08-23 08:21:55 -06:00
nc.h Improve parallel create/open mode logic. 2018-09-17 17:18:48 -05:00
ncauth.h
ncbytes.h
ncconfigure.h Fixed a shell script error on vs15 2018-05-14 14:37:07 -06:00
ncdap.h Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
ncdimscale.h moved hdf5 specific header stuff to hdf5internal.h 2018-07-12 07:05:21 -06:00
ncdispatch.h Add some visual studio bug fixes 2018-10-11 12:09:42 -06:00
ncexternl.h
ncfilter.h Rebuilt the filter parameter handling code to use a common 2018-01-23 16:00:11 -07:00
nchashmap.h This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
ncindex.h This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
nclist.h This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
nclog.h Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
ncoffsets.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncrc.h Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
nctestserver.h re: github issues 2018-10-30 20:48:12 -06:00
nctime.h
ncuri.h Made some changes to export symbols on Windows builds. 2018-08-02 14:58:47 -06:00
ncutf8.h
ncwinpath.h Fix the NC_INMEMORY code to work in all cases with HDF5 1.10. 2018-09-04 11:27:47 -06:00
netcdf_aux.h Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
netcdf_f.h
netcdf_mem.h Remove unneeded include of netcdf.h from netcdf_mem.h 2018-09-23 14:16:45 -06:00
netcdf_meta.h.in Use PnetCDF instead of parallel-netcdf to avoid confusion with 2018-09-17 17:18:48 -05:00
netcdf_par.h added more documentation 2017-11-08 03:33:44 -07:00
netcdf.h Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
onstack.h onstack: check whether HAVE_ALLOCA_H is defined or not 2018-02-19 10:14:19 -05:00
rnd.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
XGetopt.h