Commit Graph

465 Commits

Author SHA1 Message Date
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
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
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
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
46e50bc196 more tests for NULL strides 2018-12-31 09:44:29 -07:00
Ward Fisher
c62d7eb541 Merge remote-tracking branch 'origin/gh1233.dmh' into pr-aggregation.wif 2018-12-30 23:55:30 -08:00
Dennis Heimbigner
ac528ae34e T.B. found a couple more 2018-12-12 15:14:19 -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
Ward Fisher
30ea33435c Merge remote-tracking branch 'origin/license_update.wif' into pr-aggregation.wif 2018-12-11 17:08:21 -05:00
Ward Fisher
e9f617e335 Testing a fix for a failure I observed. 2018-12-06 17:46:30 -07:00
Ward Fisher
763750fab5 More copyright stanza updates. 2018-12-06 14:56:42 -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
Dennis Heimbigner
30d63bbaa5 Fix failings of nc_test/run_inmemory.sh
re: issue https://github.com/Unidata/netcdf-c/issues/1233

Changes:

1. remove exit that was there for testing.
2. the program tst_open_mem must be netcdf-4 only.
3. fix some diff problems
   - Change dataset name for tst_inmemory4_create to tst_inmemory4
   - Modify tst_inmemory.c to reorder the variables (somewhat major rewrite)

Minor Unrelated Fixes:
1. fix comment problem in nc_provenance.h
2. Fix memory leak in tst_open_mem.c
3. fix ncdump/bindata.c to properly compile if netcdf4 is disabled.
4. minor changes to ncgen.l
2018-12-04 19:22:02 -07:00
Ed Hartnett
846153b3fd makefile.am cleanup 2018-12-03 07:42:34 -07:00
Ed Hartnett
88029414c8 fix memory leak 2018-12-03 06:33:16 -07:00
Ed Hartnett
693271c278 now always relax coord bounds checking, also fix parallel builds for --enable-pnetcdf 2018-12-03 06:17:23 -07:00
Ed Hartnett
bbfbd98f6e test and util changes to split libsrc4 and libhdf5 2018-12-01 08:24:56 -07:00
Ed Hartnett
db83d0b4bf got disable-hdf5 builds working without utils 2018-12-01 07:29:58 -07:00
Ward Fisher
6ca12e3194 Merge branch 'patch-29' of https://github.com/gsjaardema/netcdf-c into pr-aggregation.wif 2018-11-28 13:30:40 -07:00
Dennis Heimbigner
82e46ef594 Update nc_test/tst_inmemory to cover more cases
re: pull request https://github.com/Unidata/netcdf-c/pull/1219

This pr should go in after or at the same time as 1219.
It updates nc_test/tst_inmemory to add a test to cover
the case fixed in 1219. It also disables a couple of tests
that no longer are relevant.
2018-11-27 19:20:19 -07:00
Greg Sjaardema
e33506030d Modify test to increase code coverage
By increasing the DIM1 size, the created in-memory file will be
larger than the default memory allocation size (4096), so the code
will have to reallocate the memory which results in more code coverage.
2018-11-27 14:00:43 -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
Dennis Heimbigner
571cf6b933 Fix test run_diskless2.sh with LARGE_FILE_TESTS
ret: https://github.com/Unidata/netcdf-c/issues/1162

The test nc_test/run_diskless2.sh fails
when LARGE_FILE_TESTS is enabled.
Since the goal of the test was to test out
diskless+persist on a reasonably large file,
I fixed by just limiting the file size to
1000000000L bytes.
2018-11-03 11:51:10 -06: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
Ed Hartnett
37a36395d7 more tests for late fill 2018-10-17 11:14:53 -06:00
Ed Hartnett
91ec0109f3 more testing for late fill setting 2018-10-17 09:44:18 -06:00
Ed Hartnett
d959512a2e adding tests for ELATEFILL in all available formats 2018-10-17 07:29:30 -06:00
Ed Hartnett
4f75d0873b cleanup of Makefile.am 2018-10-17 07:16:00 -06:00
Dennis Heimbigner
553de966d6 Add some visual studio bug fixes 2018-10-11 12:09:42 -06:00
Dennis Heimbigner
4636584d5b Revert/Improve nc_create + NC_DISKLESS behavior
re: https://github.com/Unidata/netcdf-c/issues/1154

Inadvertently, the behavior of NC_DISKLESS with nc_create() was
changed in release 4.6.1. Previously, the NC_WRITE flag needed
to be explicitly used with NC_DISKLESS in order to cause the
created file to be persisted to disk.

Additional analyis indicated that the current NC_DISKLESS
implementation was seriously flawed.

This PR attempts to clean up and regularize the situation with
respect to NC_DISKLESS control. One important aspect of diskless
operation is that there are two different notions of write.

1. The file is read-write vs read-only when using the netcdf API.
2. The file is persisted or not to disk at nc_close().

Previously, these two were conflated. The rules now are
as follows.

1. NC_DISKLESS + NC_WRITE means that the file is read/write using the netcdf API
2. NC_DISKLESS + NC_PERSIST means that the file is persisted to a disk file at nc_close.
3. NC_DISKLESS + NC_PERSIST + NC_WRITE means both 1 and 2.

The NC_PERSIST flag is new and takes over the obsolete NC_MPIPOSIX flag.
NC_MPIPOSIX is still defined, but is now an alias for the NC_MPIIO flag.

It is also now the case that for netcdf-4, NC_DISKLESS is independent
of NC_INMEMORY and in fact it is an error to specify both flags
simultaneously.

Finally, the MMAP code was fixed to use NC_PERSIST as well.
Also marked MMAP as deprecated.

Also added a test case to test various combinations of NC_DISKLESS,
NC_PERSIST, and NC_WRITE.

This PR affects a number of files and especially test cases
that used NC_DISKLESS.

Misc. Unrelated fixes
1. fixed some warnings in ncdump/dumplib.c
2018-10-10 13:32:17 -06:00
Ward Fisher
ea66842bea
Merge branch 'master' into nc_mpiio_nc_mpiposix 2018-10-09 15:21:50 -06:00
Dennis Heimbigner
534364b069 This Pre removed #include <netcdf.h> from netcdf_mem.h.
In turn that caused some problems elsewhere because some files
did not include netcdf.h preceding netcdf_mem.h. Specifically,
building under visual studio fails.
So fix those cases that I can find. May need to
add more later.
2018-10-07 12:05:26 -06:00
Wei-keng Liao
0ed70756cc Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
Wei-keng Liao
50e5b4fe8b remove unused files, test_get_p5.m4 is covered by test_get.m4 2018-09-22 18:21:55 -05:00
Wei-keng Liao
28512f77f0 remove unused variables 2018-09-18 01:27:57 -05:00
Wei-keng Liao
5d297238d5 fix nc_test/tst_addvar.c. This program reads output file
tst_pnetcdf.nc generated from tst_pnetcdf.c.
2018-09-17 17:18:48 -05:00
Wei-keng Liao
48da78e133 Use PnetCDF instead of parallel-netcdf to avoid confusion with
parallel netcdf4. Also, update PnetCDF web page.
2018-09-17 17:18:48 -05:00
Wei-keng Liao
64e2982d0f adjust test logics for NC_ENOTBUILT 2018-09-17 17:18:48 -05:00
Wei-keng Liao
d24f292077 return NC_ENOTBUILT when CDF5 is not enabled but NC_64BIT_DATA is used 2018-09-17 17:18:48 -05:00
Wei-keng Liao
668e3021a8 Check if NC_ENOTBUILT is returend when PnetCDF feature is not
enabled but NC_PNETCDF is used in cmode or omode.
2018-09-17 17:18:48 -05:00
Ward Fisher
784d777bff Merge branch 'master' into provenance.dmh 2018-09-06 15:13:09 -06:00
Dennis Heimbigner
d62a9e623c Fix the NC_INMEMORY code to work in all cases with HDF5 1.10.
re: github issue https://github.com/Unidata/netcdf-c/issues/1111

One of the less common use cases for the in-memory feature is
apparently failing with HDF5-1.10.x.  The fix is complicated and
requires significant changes to libhdf5/nc4memcb.c. The current
setup is detailed in the file docs/inmeminternal.dox.

Additionally, it was discovered that the program
nc_test/tst_inmemory.c, which is invoked by
nc_test/run_inmemory.sh, actually was failing because of the
above problem. But the failure is not detected since the script
does not return non-zero value.

Other Changes:
1. Fix nc_test_tst_inmemory to return errors correctly.
2. Make ncdap_tests/findtestserver.c and dap4_tests/findtestserver4.c
   be generated from ncdap_test/findtestserver.c.in.
3. Make LOG() print output to stderr instead of stdout to
   avoid contaminating e.g. ncdump output.
4. Modify the handling of NC_INMEMORY and NC_DISKLESS flags
   to properly handle that NC_DISKLESS => NC_INMEMORY. This
   affects a number of code pieces, especially memio.c.
2018-09-04 11:27:47 -06:00
Ward Fisher
ede7c5da60
Merge branch 'master' into provenance.dmh 2018-09-04 11:22:36 -06:00
Ward Fisher
5e33522f52
Merge branch 'master' into default_format 2018-08-28 15:02:17 -06:00