netcdf-c/ncdump
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
..
cdl Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
expected
bom.c make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
cdl.h Add new capabilities to filter code: 2017-05-14 18:10:02 -06:00
chunkspec.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
chunkspec.h This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725. 2018-07-26 20:16:02 -06:00
CMakeLists.txt Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ctests.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
depend
dimmap.c
dimmap.h
dumplib.c Revert/Improve nc_create + NC_DISKLESS behavior 2018-10-10 13:32:17 -06:00
dumplib.h Begin changing over to use strlcat instead of strncat because 2017-11-23 10:55:24 -07:00
env
indent.c
indent.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
inttags4.cdl re: gihub issue https://github.com/Unidata/netcdf-c/issues/380 2017-03-24 18:56:14 -06:00
inttags.cdl
isnan.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
L512.bin re e-support UBS-599337 2017-10-24 16:25:09 -06:00
list.c This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725. 2018-07-26 20:16:02 -06:00
list.h This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725. 2018-07-26 20:16:02 -06:00
Makefile.am Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
nc4print.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
nccomps.h
nccopy.1 Fix failure in the nccopy -c option 2018-11-12 12:59:56 -07:00
nccopy.c Merge branch 'master' into provenance.dmh 2018-09-04 11:22:36 -06:00
ncdump.1
ncdump.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
ncdump.h
nciter.c
nciter.h re: github issues 2018-10-30 20:48:12 -06:00
nctime0.c changed macro STREQ to NCSTREQ to avoid name collusion with HDF4 library 2018-05-12 08:55:51 -06:00
nctime0.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
nctrunc.c make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
ocprint.c Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
ref1.ncml
ref_ctest1_nc4.cdl Wiring in more validation 2016-11-18 11:53:53 -07:00
ref_ctest1_nc4c.cdl
ref_ctest64.c different attempt to deal with ncdump dependencies 2017-11-11 17:33:51 -07:00
ref_ctest.c another attempt at reducing ncdump dependencies 2017-11-11 16:45:03 -07:00
ref_inttags4.cdl Working on getting cdf5 tests running. 2017-09-15 18:00:28 -06:00
ref_inttags.cdl
ref_nc_test_netcdf4_4_0.nc
ref_nc_test_netcdf4.cdl
ref_nccopy3_subset.nc Wiring new test into autotools. 2017-09-01 11:57:28 -06:00
ref_null_byte_padding_test.nc Wiring in a quick test. 2017-11-20 13:52:06 -07:00
ref_provenance_v1.nc There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
ref_test_360_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_360_day_1900.nc Makefile.am cleanup 2017-11-18 14:20:04 -07:00
ref_test_365_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_365_day_1900.nc Makefile.am cleanup 2017-11-18 14:20:04 -07:00
ref_test_366_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_366_day_1900.nc Makefile.am cleanup 2017-11-18 14:20:04 -07:00
ref_test_corrupt_magic.nc re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ref_times.cdl
ref_tst_charfill.cdl
ref_tst_comp2.cdl
ref_tst_comp.cdl
ref_tst_compounds2.cdl
ref_tst_compounds2.nc
ref_tst_compounds3.cdl
ref_tst_compounds3.nc
ref_tst_compounds4.cdl
ref_tst_compounds4.nc
ref_tst_enum_data.cdl
ref_tst_fillbug.cdl
ref_tst_format_att_64.cdl
ref_tst_format_att.cdl
ref_tst_group_data_v23.cdl
ref_tst_group_data.cdl
ref_tst_grp_spec0.cdl
ref_tst_grp_spec.cdl
ref_tst_irish_rover.nc tests for ncdump issue with irish rover 2018-05-15 08:09:52 -06:00
ref_tst_mud4_chars.cdl
ref_tst_mud4-bc.cdl
ref_tst_mud4.cdl
ref_tst_nans.cdl
ref_tst_nc4_utf8_4.cdl Work towards parallel testing via cmake. 2017-11-22 12:10:58 -07:00
ref_tst_ncf213.cdl There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
ref_tst_noncoord.cdl
ref_tst_opaque_data.cdl
ref_tst_small.cdl
ref_tst_solar_1.cdl
ref_tst_solar_2.cdl
ref_tst_special_atts3.cdl
ref_tst_special_atts.cdl There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
ref_tst_string_data.cdl
ref_tst_unicode.cdl
ref_tst_utf8_4.cdl
ref_tst_utf8.cdl
ref_tst_vlen_data2.cdl
ref_tst_vlen_data.cdl
rewrite-scalar.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_back_comp_tests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_ncgen_nc4_tests.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
run_ncgen_tests.sh replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
run_tests.sh moved irish rover ncdump test to netcdf-4 test script 2018-05-15 08:13:25 -06:00
run_utf8_nc4_tests.sh eliminated dependencies 2017-11-25 05:18:04 -07:00
run_utf8_tests.sh eliminated dependencies 2017-11-25 05:18:04 -07:00
small2.cdl
small.cdl
test0.cdl
test_corrupt_magic.cdl re e-support UBS-599337 2017-10-24 16:25:09 -06:00
tst_64bit.sh replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
tst_bom.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_brecs.cdl
tst_bug321.cdl
tst_calendars.cdl
tst_calendars.sh Makefile.am cleanup 2017-11-18 14:20:04 -07:00
tst_charfill.cdl
tst_charfill.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_chunking.c This PR primarily addresses Issue https://github.com/Unidata/netcdf-c/issues/725. 2018-07-26 20:16:02 -06:00
tst_comp2.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_comp.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_compress.c move C program invokations to scripts to clean up dependencies in build 2017-11-16 13:03:35 -07:00
tst_create_files.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_dimsizes.c merged master 2018-07-23 09:45:39 -06:00
tst_dimsizes.sh make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
tst_enum_data.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_fileinfo.c There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
tst_fileinfo.sh There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
tst_fillbug.c re: github issues 2018-10-30 20:48:12 -06:00
tst_fillbug.sh move C program invokations to scripts to clean up dependencies in build 2017-11-16 13:03:35 -07:00
tst_formatx3.sh replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
tst_formatx4.sh make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
tst_group_data.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_grp_spec.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_h_rdc0.c removing dependencies between tests 2017-11-25 05:19:11 -07:00
tst_h_scalar.c move C program invokations to scripts to clean up dependencies in build 2017-11-16 13:03:35 -07:00
tst_h_scalar.sh move C program invokations to scripts to clean up dependencies in build 2017-11-16 13:03:35 -07:00
tst_hdf5_offset.sh Swapped /bin/bash for /bin/sh to test on osx. 2018-08-12 23:01:08 -06:00
tst_inmemory_nc3.sh make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
tst_inmemory_nc4.sh make -j working for classic only in ncdump 2017-11-17 08:22:49 -07:00
tst_inttags4.sh Working on getting cdf5 tests running. 2017-09-15 18:00:28 -06:00
tst_inttags.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_iter.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_lengths.sh replace USE_CDF5 with ENABLE_CDF5 2018-06-29 21:17:07 -05:00
tst_mslp.cdl
tst_mud.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_nans.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_nccopy3_subset.sh Swapped /bin/bash for /bin/sh to test on osx. 2018-08-12 23:01:08 -06:00
tst_nccopy3.sh There was a request to extend the provenance information 2018-08-25 21:44:41 -06:00
tst_nccopy4.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
tst_nccopy5.sh Fix failure in the nccopy -c option 2018-11-12 12:59:56 -07:00
tst_ncgen4_classic.sh The ncdap_tests were a mess, so I decided to clean them up 2018-03-20 21:31:31 -06:00
tst_ncgen4_cycle.sh removed many dependencies in ncdump testing 2017-11-25 07:28:07 -07:00
tst_ncgen4_diff.sh removed many dependencies in ncdump testing 2017-11-25 07:28:07 -07:00
tst_ncgen4.sh Swapped /bin/bash for /bin/sh to test on osx. 2018-08-12 23:01:08 -06:00
tst_ncgen_shared.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
tst_ncml.cdl
tst_netcdf4_4.sh Updated and removed a check for _NCProperties during file comparison, as this test fails if the environment is different from the environment the reference file was built on. 2018-09-06 15:53:25 -06:00
tst_netcdf4.sh Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
tst_null_byte_padding.sh Corrected pathing oversight. 2017-11-21 12:17:32 -07:00
tst_opaque_data.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_output.sh 1. Keep up to date by merging master 2018-01-16 11:00:09 -07:00
tst_special_atts.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_string_data.c move C program invokations to scripts to clean up dependencies in build 2017-11-16 13:03:35 -07:00
tst_unicode.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_utf8.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_vlen_data.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_vlen_demo.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
utils.c re: github issues 2018-10-30 20:48:12 -06:00
utils.h re: github issues 2018-10-30 20:48:12 -06:00
vardata.c Fix more memory leaks in netcdf-c library 2018-11-15 10:00:38 -07:00
vardata.h added guards for header files that needed them 2018-01-17 09:20:20 -07:00
XGetopt.c