Commit Graph

692 Commits

Author SHA1 Message Date
Ed Hartnett
e859be9a1d more testing 2019-01-27 11:38:39 -07:00
Ed Hartnett
42c64598dc created function create_dim_wo_var() 2019-01-27 10:51:25 -07:00
Ed Hartnett
713804ea03 added rename test to tst_rename2.c which fails :-( 2019-01-24 10:01:46 -07:00
Ed Hartnett
59ee728b93 fixed parallel build problem with tst_files2.c when --enable-benchmarks is used 2019-01-20 10:07:13 -07:00
Ward Fisher
2285e1dfa1 Merge branch 'ejh_test_null_vars_stride' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-01-15 15:10:40 -07:00
Ward Fisher
c6ca9dfa1e Merge branch 'ejh_coords_3' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into pr-aggregation.wif 2019-01-15 15:03:36 -07:00
Ward Fisher
9a365be6d0 Merge branch 'ansifix.dmh' into pr-aggregation.wif 2019-01-15 14:58:54 -07:00
Ed Hartnett
ee1680bb80
Merge branch 'master' into ejh_relax 2019-01-03 05:18:57 -07:00
Ed Hartnett
e1785cd324
Merge branch 'master' into ejh_coords_3 2019-01-03 05:18:41 -07:00
Ed Hartnett
c278109c9f
Merge branch 'master' into ejh_test_null_vars_stride 2019-01-03 05:18:25 -07:00
Ward Fisher
c21820a1ae Merge branch 'master' into ansifix.dmh 2019-01-02 22:26:59 -08:00
Ward Fisher
94af1d49c6
Merge branch 'master' into ansicomment.dmh 2019-01-02 20:51:28 -08:00
Ed Hartnett
5e66c086a2 took config include out of h5testszip 2019-01-02 06:46:56 -07:00
Ed Hartnett
35017d9549 fixed mistake in Makefile.am 2019-01-02 06:21:11 -07:00
Ed Hartnett
140967e174 more config.h includes for tests 2019-01-02 05:37:54 -07:00
Ed Hartnett
c15c3fa8d5 cleaned up makefile.am, added config.h to some tests 2019-01-02 05:31:15 -07:00
Ed Hartnett
bdf7eef7c6 merged master 2019-01-02 03:52:51 -07:00
Ed Hartnett
35495eb734
Merge branch 'master' into ejh_test_null_vars_stride 2019-01-02 03:49:22 -07:00
Ed Hartnett
091880fd4d fixed null stride problem for vars calls 2018-12-31 07:36:39 -07:00
Ed Hartnett
322840e4cf benchmarking test work 2018-12-31 07:02:18 -07:00
Ed Hartnett
563f9088f2 cleaned up, added wrf checm file test 2018-12-23 06:29:59 -07:00
Ed Hartnett
029aa5f626 now using hidden coordinates att to speed file opens 2018-12-20 05:59:31 -07:00
Ed Hartnett
1b38d9aef8 lazy read of some var metadata 2018-12-18 07:48:22 -07:00
Ed Hartnett
b2fbc71bd4 added test, uncommented some test code 2018-12-17 09:24:47 -07:00
Ed Hartnett
dc982efb3d moved tst_attsperf to be with rest of benchmarks 2018-12-17 08:44:36 -07:00
Dennis Heimbigner
75759ca957 Separate out the --ansi comment fixes.
re: pull request https://github.com/Unidata/netcdf-c/pull/1242

This pr should be applied before https://github.com/Unidata/netcdf-c/pull/1242.
It fixes only the -ansi '//' comment problems. There may be some
slight conflicts with that other pr when it is applied, since in some
cases I converted #if 0...#endif to /*...*/
2018-12-12 13:23:09 -07:00
Dennis Heimbigner
735ae80928 merge master and fix conflicts 2018-12-12 11:47:54 -07:00
Ed Hartnett
8ca5a1ac17
Merge branch 'master' into ejh_fast_var_prep 2018-12-12 07:05:45 -07:00
Ed Hartnett
f724fe6385 uncommented test in tst_interops.c 2018-12-11 06:34:44 -07:00
Ed Hartnett
89b2c48d4c added benchmark program tst_wrf_reads.c 2018-12-11 06:32:25 -07:00
Ward Fisher
d135fb4200 Removed confounding text from a reference file, turned on filter testing by default in Cmake-based builds. 2018-12-07 14:44:47 -07:00
Ward Fisher
462ec93913 Whew! Updated copyright stanza in nc_test4. 2018-12-06 15:27:32 -07:00
Dennis Heimbigner
1a7531392f Make the netcdf-c library compile with gcc -ansi.
Primary fixes to get -ansi to work.
1. Convert all '//' C++ style comments to /*...*/ or to use #if 0...#endif
2. It turns out that when -ansi is specified, then a number of
   functions no longer are defined in the header -- but they are still
   in the .so file.<br>
   The big example is strdup(). So, added code to include/ncconfig.h to define
   externs for those missing functions that occur in more than one place.
   These are enabled if !_WIN32 && __STDC__ == 1 (__STDC__ is supposed to
   be the equivalent compile time flag to -ansi). Note that this requires
   config.h (which references ncconfig.h) to be included in files where it is
   currently not included. Single uses will be only in the file that uses them.
3. Added mmap test for the MAP_ANONYMOUS flag to configure.ac. Apparently
   this is not always defined with -ansi.
4. fix some large integer constants in nc_test4/tst_atts3.c and nc_test4/tst_filterparser.c
   to avoid compiler complaints.
5. fix a double constant in nc_test4/tst_filterparser.c to avoid compiler complaints.

[Note I suspect #4 and #5 will be a problem on big-endian machines, but we have no way to test]

Misc. Changes:
1. convert more instances of _MSC_VER to _WIN32.
2. added some debugging code to include/nctestserver.h
3. added comment about libdispatch/drc.c always being compiled.
4. modify parser generation in ncgen to remove unneeded files.
2018-12-05 19:20:43 -07:00
Ed Hartnett
846153b3fd makefile.am cleanup 2018-12-03 07:42:34 -07:00
Ed Hartnett
262763c254 clean up 2018-11-16 10:01:31 -07:00
Ward Fisher
53dc9022be Merge remote-tracking branch 'origin/ncgenmem.dmh' into tmptmp 2018-11-15 10:20:08 -07:00
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
Ward Fisher
619f0f1bdf
Merge branch 'master' into patch-28 2018-11-14 13:16:24 -07:00
Greg Sjaardema
a519c12f52
Remove extra argument
Removes extra argument to match function prototype in `NC_Dispatch` as described in #1196
2018-11-14 10:35:58 -07:00
Ed Hartnett
c62804f1f2 whitespace issues 2018-11-09 05:48:30 -07:00
Ed Hartnett
c3d5c43662 fixed test output 2018-11-09 05:45:29 -07:00
Ed Hartnett
1a858e847b fixed test output 2018-11-09 05:41:35 -07:00
Dennis Heimbigner
245961de00 re: github issues
https://github.com/Unidata/netcdf-c/issues/1168
    https://github.com/Unidata/netcdf-c/issues/1163
    https://github.com/Unidata/netcdf-c/issues/1162

This PR partially fixes memory leaks in the netcdf-c library,
in the ncdump utility, and in some test cases.

The netcdf-c library now runs memory clean with the assumption
that the --disable-utilities option is used. The primary remaining
problem is ncgen. Once that is fixed, I believe the netcdf-c library
will run memory clean with no limitations.

Notes
-----------
1. Memory checking was performed using gcc -fsanitize=address.
   Valgrind-based testing has yet to be performed.
2. The pnetcdf, hdf4, and examples code has not been tested.

Misc. Non-leak changes
1. Make tst_diskless2 only run when netcdf4 is enabled (issue 1162)
2. Fix CmakeLists.txt to turn off logging if ENABLE_NETCDF_4 is OFF
3. Isolated all my debug scripts into a single top-level directory
   called debug
4. Fix some USE_NETCDF4 dependencies in nc_test and nc_test4 Makefile.am
2018-10-30 20:48:12 -06:00
Dennis Heimbigner
a5a34f6aba
Merge branch 'master' into nc_mpiio_nc_mpiposix 2018-10-06 13:33:55 -06:00
Dennis Heimbigner
d07c05b58f Fix memory problems when using HDF5 version 1.10.x and later.
re: issue https://github.com/Unidata/netcdf-c/issues/1156

Starting with HDF5 version 1.10.x, the plugin code MUST be
careful when using the standard *malloc()*, *realloc()*, and
*free()* function.

In the event that the code is allocating, reallocating, or
free'ing memory that either came from -- or will be exported to --
the calling HDF5 library, then one MUST use the corresponding
HDF5 functions *H5allocate_memory()*, *H5resize_memory()*,
*H5free_memory()* [5] to avoid memory failures.

Additionally, if your filter code leaks memory, then the HDF5 library
generates a failure something like this.
````
H5MM.c:232: H5MM_final_sanity_check: Assertion `0 == H5MM_curr_alloc_bytes_s' failed.
````

This PR modifies the code in the plugins directory to
conform to these new requirements.

This raises a question about the libhdf5 code where this
same problem may occur. We need to scan especially nc4hdf.c
to look for this problem.
2018-10-04 11:37:21 -06:00
Dennis Heimbigner
dd654a272e Remove debug from tst_filter.sh 2018-10-01 15:54:25 -06:00
Dennis Heimbigner
8072d1f6bb Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch
re: issue https://github.com/Unidata/netcdf-c/issues/1151

Modify DAP2 and DAP4 code to handle case when _FillValue type is not
same as the parent variable type.

Specifically:
1. Define a parameter [fillmismatch] to allow this mismatch;
   default is to disallow.
2. If allowed, forcibly change the type of the _FillValue to match
   the parent variable.
3. If allowed Convert the values to match new type
4. Generate a log message
5. if not allowed, then fail

Implementing this required some changes to ncdap_test/dapcvt.c
Also added test cases.

Minor Unrelated Changes:
1. There were a number of warnings about e.g.
   assigning a const char* to a char*. Fix these
2. In nccopy.1, replace .NP with .IP "n"
   (re PR https://github.com/Unidata/netcdf-c/pull/1144)
3. fix minor error in ncdump/ocprint
2018-10-01 15:51:43 -06:00
Wei-keng Liao
0ed70756cc Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
Ward Fisher
5259b4b1e8
Merge branch 'master' into ejh_hdf5_sep_next_2 2018-09-17 14:53:55 -06:00
Dennis Heimbigner
108dc0f01d Fix szip filter handling code and correspondingtests
re: https://github.com/Unidata/netcdf-c/issues/972

The current szip plugin code in the HDF5 library has some
unexpected behaviors that require some changes to how
nc_inq_var_szip is implemented and to the corresponding tests:
nc_test4/{test_szip,tst_vars3}.

Specifically, the following can happen:

1. The number of parameters provided by the user will be two,
   but the number of parameters returned by nc_inq_var_filter
   will be four because the HDF5 code (H5Zszip) will add two
   extra parameters for internal use. It turns out that the two
   parameters provided when calling nc_def_var_filter correspond
   to the first two parameters of the four parameters returned
   by nc_inq_var_filter.

2. The nc_inq_var_szip values corresponding to the ones provided
   by the caller may be different than those provided by
   nc_def_var_filter.  The value of the options_mask argument is
   known to add additional flag bits, and the pixels_per_block
   parameter may be modified.
2018-09-15 15:21:51 -06:00