Commit Graph

674 Commits

Author SHA1 Message Date
Ed Hartnett
26f4bfdd28 added comment about function ordering 2019-02-25 12:23:54 -07:00
Ed Hartnett
d0a6e9c246 more work on var documentation 2019-02-25 12:20:53 -07:00
Ed Hartnett
ea5e7f9b9a fixing some documentation issues in hdf5var.c 2019-02-25 10:44:05 -07:00
Ed Hartnett
d47006fd3f fixing some documentation issues in hdf5var.c 2019-02-25 10:32:17 -07:00
Ed Hartnett
160186d52e more doc cleanup 2019-02-25 08:35:18 -07:00
Ed Hartnett
c2c2f8e044 cleanup of var docs 2019-02-25 08:25:12 -07:00
Ed Hartnett
c620d8c5c7 more documentation cleanup 2019-02-25 08:15:43 -07:00
Ed Hartnett
2f8f5baf0f more documentation cleanup 2019-02-25 08:14:42 -07:00
Ed Hartnett
3277ef2359 formatting cleanup 2019-02-25 07:58:55 -07:00
Ed Hartnett
0e204ebe0c formatting cleanup 2019-02-25 07:55:29 -07:00
Ed Hartnett
7dc9097d62 cleaned away uncorrect section 2019-02-25 07:48:29 -07:00
Ed Hartnett
2dd178bfa1 documentation cleanup 2019-02-25 07:37:23 -07:00
Ed Hartnett
f83c8a5d3a documentation of dim rename for netcdf-4 vs classic 2019-02-25 07:32:06 -07:00
Ed Hartnett
fba4c19953 documentation cleanup 2019-02-25 07:28:35 -07:00
Ed Hartnett
05d549e900 fixed doxygen warnings in RELEASE_NOTES.md 2019-02-25 07:16:47 -07:00
Ed Hartnett
3997511379 documentation work 2019-02-25 06:50:53 -07:00
Ed Hartnett
953e0ab668 documentation work 2019-02-25 06:46:32 -07:00
Ed Hartnett
f02d1151f6 documentation work 2019-02-25 06:41:13 -07:00
Ward Fisher
6c3b7a0077
Merge branch 'master' into urlauth.dmh 2019-02-13 16:32:38 -07:00
Dennis Heimbigner
4cd440dd96 URL with username+pwd in url is not working.
re: esupport (DVK-211460)

Turns out it was a typo in libdispatch/dauth.c
Fix is to Change:
HTTP.USERNAME -> HTTP.CREDENTIALS.USERNAME
and
HTTP.PASSWORD-> HTTP.CREDENTIALS.PASSWORD
2019-02-09 15:06:03 -07:00
Ward Fisher
3a14251dd9
Merge branch 'master' into bigend.dmh 2019-02-07 14:28:39 -07:00
Dennis Heimbigner
8714066b18 Fix errors when building on big-endian machine
re: issue https://github.com/Unidata/netcdf-c/issues/1278
re: issue https://github.com/Unidata/netcdf-c/issues/876
re: issue https://github.com/Unidata/netcdf-c/issues/806

* Major change to the handling of 8-byte parameters for nc_def_var_filter.
  The old code was not well thought out.
  * The new algorithm is documented in docs/filters.md.
  * Added new utility file plugins/H5Zutil.c to support
  * Modified plugins/H5Zmisc.c to use new algorithm
  the new algorithm.
  * Renamed include/ncfilter.h to include/netcdf_filter.h
    and made it an installed header so clients can access the
    new algorithm utility.
  * Fixed nc_test4/tst_filterparser.c and nc_test4/test_filter_misc.c
    to use the new algorithm
* libdap4/ fixes:
  * d4swap.c has an error in the endian pre-processing such
    that record counts were not being swapped correctly.
  * d4data.c had an error in that checksums were being computed
    after endian swapping rather than before.
* ocinitialize() was never being called, so xxdr bigendian handling
  was never set correctly.
  * Required adding debug statements to occompile
* Found and fixed memory leak in ncdump.c

Not tested:
* HDF4
* Pnetcdf
* parallel HDF5
2019-01-31 21:13:06 -07:00
Ward Fisher
688c06d50c
Merge branch 'master' into fix-warnings 2019-01-23 15:12:20 -07:00
Ben Boeckel
82d72dfa47 nctime: expand basetime's size
It ends up being `basetime_1 + basetime_2` with a space in between. Make
enough room to ensure that it is not truncated.
2019-01-16 15:55:33 -05:00
Ben Boeckel
8c331222ec warnings: store sizes in size_t 2019-01-16 15:55:33 -05:00
Ben Boeckel
94a0259f0e NC_mktmp: pass the remaining space to strncat
This could overflow if `tmp` only had a few bytes left in its space
given its current contents.
2019-01-16 15:55:33 -05:00
Ben Boeckel
b3f34432a3 warnings: mark unused parameters 2019-01-16 15:55:33 -05:00
Ben Boeckel
eb0b9b8bbd ncuri: check the right preprocessor definition 2019-01-16 15:53:26 -05:00
Ben Boeckel
a747216c33 warnings: mark conditionally used parameters 2019-01-16 15:53:25 -05: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
Ed Hartnett
c278109c9f
Merge branch 'master' into ejh_test_null_vars_stride 2019-01-03 05:18:25 -07:00
Ed Hartnett
091880fd4d fixed null stride problem for vars calls 2018-12-31 07:36:39 -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
Dennis Heimbigner
643b2159ce
Remove the unused strdup definition from dstring.c
Actually was never needed
2018-12-12 11:32:31 -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
25417880f7 Updated libdispatch/ files with copyright notice. 2018-12-06 14:29:57 -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
Ward Fisher
991dbabfa6 Removed old directory in support of https://github.com/Unidata/netcdf-c/issues/1235 2018-12-04 15:20:26 -07:00
Ed Hartnett
db83d0b4bf got disable-hdf5 builds working without utils 2018-12-01 07:29:58 -07:00
Ed Hartnett
c824ad9ec9 further removal of libhdf5 code from libsrc4 2018-11-28 15:48:08 -07:00
Ed Hartnett
0e9784a867 more changes to separate HDF5 from libsrc4 initialization 2018-11-26 05:44:59 -07:00
Ed Hartnett
9b90c7744e changes in support of separating HDF5 and libsrc4 2018-11-26 04:35:00 -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
8b75fbb6d9 Corrected VS2010 compilation issue in support of https://github.com/Unidata/netcdf-c/issues/1184 . Solution provided by Mark Rivers on the NetCDF mailing list. 2018-11-08 12:37:03 -07:00
Ward Fisher
0d5219ce82 Merge remote-tracking branch 'origin/ncgenjava.dmh' into v4.6.2-release-branch.wif 2018-11-05 15:10:32 -07:00
Dennis Heimbigner
a2c3ae18ed Fix bug in utf8 -> utf16 conversion with ncgen -l java.
re: issue https://github.com/Unidata/netcdf-c/issues/1171
ncgen was checking validity of the utf8->utf16 conversion
incorrectly.
2018-10-31 21:10:51 -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
91ec0109f3 more testing for late fill setting 2018-10-17 09:44:18 -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