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 Added a new .gitignore specific to include/. 2014-09-18 15:05:08 -06:00
ceconstraints.h Fix Jirs 255 2013-05-16 18:22:17 +00:00
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 minor refactor of the build system to work better for cross-compiling 2011-03-15 10:19:08 +00:00
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 Corrected an issue preventing gcc-4.4 from compiling netcdf. 2016-04-26 21:09:41 +00:00
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 This pr should probably be delayed until after Version 4.5. 2017-09-02 18:09:36 -06:00
ncbytes.h Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
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 Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
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 Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-24 18:59:16 -06:00
ncuri.h Made some changes to export symbols on Windows builds. 2018-08-02 14:58:47 -06:00
ncutf8.h re: pull request https://github.com/Unidata/netcdf-c/pull/364 2017-06-18 21:06:19 -06:00
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 Merged changes from netcdf-branch. 2012-12-13 22:09:41 +00:00
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 2012-09-10 22:37:38 +00:00