netcdf-c/nc_test
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
..
bad_cdf5_begin.nc add a test program to read a CDF-5 file with a corrupted header 2017-09-16 14:04:39 -05:00
CMakeLists.txt Fix test run_diskless2.sh with LARGE_FILE_TESTS 2018-11-03 11:51:10 -06:00
error.c match type of a subroutine argument 2016-10-25 13:28:38 -05:00
error.h match type of a subroutine argument 2016-10-25 13:28:38 -05:00
f03tst_open_mem.nc Fix use of 'int' to represent 'hid_t' that caused HDF5 1.10 to fail. 2018-05-30 14:47:37 -06:00
large_files.c fixed some warnings, added some files to makefile.am to be cleaned 2017-11-26 08:50:16 -07:00
make_test_file.sh Swapped /bin/bash for /bin/sh to test on osx. 2018-08-12 23:01:08 -06:00
Makefile.am Fix test run_diskless2.sh with LARGE_FILE_TESTS 2018-11-03 11:51:10 -06:00
nc_enddef.cdl moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_sync.cdl moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_test.c replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
nc_test.html moving to trunk subdir 2010-06-03 13:24:43 +00:00
quick_large_files.c now run tst_large2, also cleaned up some more warnings 2017-11-24 10:50:07 -07:00
ref_tst_diskless2.cdl - Implemented diskless files for both netcdf classic and extended. 2012-03-26 01:34:32 +00:00
run_cdf5.sh add another test program to check if a CDF-5 file has a corrupted header 2017-09-16 14:30:09 -05:00
run_diskless2.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
run_diskless5.sh typo 2017-05-03 10:19:35 -06:00
run_diskless.sh Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
run_inmemory.sh Fix the NC_INMEMORY code to work in all cases with HDF5 1.10. 2018-09-04 11:27:47 -06:00
run_mmap.sh Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
run_pnetcdf_test.sh Use PnetCDF instead of parallel-netcdf to avoid confusion with 2018-09-17 17:18:48 -05:00
t_nc_p5.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
t_nc.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
test_get.m4 silence warnings from Travis CI 2017-03-11 12:51:04 -06:00
test_put.m4 undid unneeded nc_test changes 2018-08-13 09:15:50 -06:00
test_read.m4 Eliminate NC_MAX_VARS|DIMS|ATTRS limits 2017-07-20 09:32:29 -06:00
test_write.m4 undid unneeded nc_test changes 2018-08-13 09:15:50 -06:00
testnc3perf.c Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
tests.h This completes (for now) the refactoring of libsrc4. 2018-03-16 11:46:18 -06:00
tst_addvar.c fix nc_test/tst_addvar.c. This program reads output file 2018-09-17 17:18:48 -05:00
tst_atts3.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_big_rvar.c now run tst_large2, also cleaned up some more warnings 2017-11-24 10:50:07 -07:00
tst_big_var2.c fixed some warnings, added some files to makefile.am to be cleaned 2017-11-26 08:50:16 -07:00
tst_big_var6.c fixed some warnings, added some files to makefile.am to be cleaned 2017-11-26 08:50:16 -07:00
tst_big_var.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_cdf5_begin.c disable CDF5 tests when size_t is less than 8 bytes 2017-09-16 17:35:52 -05:00
tst_cdf5format.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_def_var_fill.c replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
tst_default_format_pnetcdf.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_default_format.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_diskless2.c Fix non-portable test that depends on nonstandardized floating-point format using e+08, not e+008. Fixes for some problems reported in scan-build static analysis. 2012-04-23 23:59:24 +00:00
tst_diskless3.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
tst_diskless4.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
tst_diskless5.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
tst_diskless5.cdl Add testcase 2017-05-03 09:58:49 -06:00
tst_diskless6.c Add some visual studio bug fixes 2018-10-11 12:09:42 -06:00
tst_diskless.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
tst_err_enddef.c Adjusted enddef test to work on 32 bit platforms as well. 2018-04-18 13:20:50 -06:00
tst_formats.c more tests for late fill 2018-10-17 11:14:53 -06:00
tst_formatx_pnetcdf.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_global_fillval.c replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
tst_inmemory.c re: github issues 2018-10-30 20:48:12 -06:00
tst_inq_type.c fixed ENABLE_CDF5 issue in some tests 2017-11-05 09:08:39 -07:00
tst_large_cdf5.c Fixed a simple mistake in test organization. 2017-08-11 18:36:44 -06:00
tst_large.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_max_var_dims.c check against NC_MAX_VAR_DIMS (but using NC_EMAXDIMS, maybe a new error code NC_EMAXVARDIMS is needed) 2017-09-21 12:37:33 -05:00
tst_meta.c Corrected second instance of macro. 2018-01-29 11:27:15 -07:00
tst_misc.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_names.c This commit fixes the logical problem of using the default file formats. 2018-07-28 11:18:28 -05:00
tst_nofill2.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nofill3.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nofill.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_norm.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_open_cdf5.c Added include to config.h 2018-02-06 13:14:15 -06:00
tst_open_mem.c minor cleanup 2018-08-16 05:42:51 -06:00
tst_parallel2.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_pnetcdf.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_small.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
tst_utf8_phrases.c fixed leaks in tests 2017-10-26 14:50:21 -06:00
tst_utf8_validate.c fixed warning 2017-11-30 05:14:19 -07:00
util.c Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00