Commit Graph

628 Commits

Author SHA1 Message Date
Quincey Koziol
1e36b5a348 [svn-r24726] Description:
Revert some earlier usage of strncpy, which was incorrect.

    Bring Coverity changes from branch back to trunk:

r20821:
    Use HDstrncpy. --gh
    (Fixed already, with strdup)

r20822:
    (Not merged, incorrect use of HDstrncpy())

r20823:
    (Not merged, incorrect use of HDstrncpy())

r20824:
    Maintenance: Bug fix: addressed CID 666.
    Value stored at *expression_len should be used in the call to
        HD5packFstring to avoid overflow (and unnecessary arithmetic
        calculation and casting) 

r20825:
    Issue 642: Added check for error and handler with print to stderr and exit.

r20826:
    Undo revision 20818, as that issue has already been fixed in the 1.8 branch
        and trunk (but not coverity branch)

r20827:
    (Not merged, incorrect use of HDstrncpy())
    
r20828:
    Use HDstrncpy. --gh
    (Corrected use of strncpy())

r20829:
    Check return of H5Lget_val(print_udata->fid, path, targbuf,
        linfo->u.val_size + 1, H5P_DEFAULT) and if error set trgbuf[0] to 0.
        Check if  H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL,
        &filename, &objname) was successful and allow print. Otherwise filename
        and objname are not created. (init those to NULL)

r20830:
    resolved coverity issues 939, 940, 941, 944, and 947.

    all were complaints about use of sprintf, and in all cases, the
    buffers used were large enough for all eventualities.

    Resolved issue by replacing calls to sprintf with calls
    to snprintf.

r20831:
    Maintenance: Addressed CID 852
    Replaced sprintf with snprintf

r20832:
    Purpose: Fix valgrind issues with hl/examples/ex_image2

    Description:
    Modified hl/examples/ex_image2 to free global "gbuf" before exit.

Tested on:
    Mac OSX/64 10.9.1 (amaon) w/C++, FORTRAN & Threadsafety
    (too minor to require h5committest)
2014-02-20 16:29:26 -05:00
Allen Byrne
b30e37ea78 [svn-r24725] HDFFV-8629: h5repack will not attempt to remove UD filters. h5repack requires a check for UD filters that also must check if the filter can be dynamically loaded. This require a change in the library that checks for this.
Tested: locally and reviewed
2014-02-20 15:21:08 -05:00
Allen Byrne
6569d7437a [svn-r24682] Add IF SHARED block around Windows PDB file generation command. 2014-02-04 10:11:36 -05:00
Quincey Koziol
2d79ba29ed [svn-r24480] Description:
Bring r24479 from 1.8 branch to trunk:

    Fix ph5diff worker command handling so it can correctly respond to
situations where there's no work to perform.  Also, a few minor code cleanups.

Tested on:
    Mac OSX/64 10.9.0 (amazon) w/parallel
    (too minor to require h5committest)
2013-11-30 13:10:36 -05:00
Larry Knox
06aa7b6641 [svn-r24285] Eliminate several "passing argument ... with different width due to prototype" warnings by casting constants to size_t where expected by string functions.
Tested on jam, koala,ostrich and platypus with h5committest.
2013-10-10 16:57:04 -05:00
Allen Byrne
4611f95d4c [svn-r24224] HDFFV-8529: Space separate define strings
Tested: h5committest
2013-09-30 11:52:03 -05:00
Larry Knox
ab239810e1 [svn-r24194] Don't add hdf5 library dependencies to lib files when --disable-sharedlib-rpath configure option is invoked. Fix for HDFFV-8276.
Tested with h5committest and on hdf-duck.
2013-09-23 20:14:24 -05:00
Allen Byrne
a8c63e28d5 [svn-r24138] Cast constants to specified type.
Cast smaller vars to larger type.
Cast calculation result to correct type.
Changed int member to hbool_t

Tested: local linux
2013-09-13 16:11:30 -05:00
Larry Knox
6b54dac504 [svn-r24115] Reduce warnings for conversions of different widths.
h5committested on jam, ostrich, koala, and platypus.
2013-09-06 17:48:28 -05:00
Quincey Koziol
5b876c929f [svn-r24101] Description:
Clean up warnings, enable new compiler warning flag(s) and bring back
changes from Coverity branch:

r20813:
Remove the dead code as listed for coverity bug #1722. h5committested.

r20814:
Issue 69: Check return value and throw error if negative return. Also free datatype id on error

r20815:
Use HDstrncpy. --gh

r20816:
Replaced one last HDstrcat call with HDstrncat to resolve coverity issue 832.

r20817:
Use HDstrncpy and HDstrncat. --gh

r20818:
Purpose: Fix valgrind issues with h5jam

Description:
Modified h5jam to free strings strdup'd in parse_command_line before exit. Note
that they may still not be freed in case of error, due to the widespread use of
exit().

r20819:
Issue 80: change loop to use int as loop index.

r20820:
Maintenance: Fixed the bug found by coverity CID 788
There were two problems with this function:
    1) it tried to unnecessary free NULL pointer
    2) it tried to allocate c_name buffer that is done by H5Pget_class_name


Tested on:
    Mac OSX 10.8.4 (amazon) w/gcc 4.8.1, C++ & FORTRAN
    (too minor to require h5committest)
2013-09-05 15:44:14 -05:00
Quincey Koziol
482a9c28e7 [svn-r24030] Description:
Clean up more compiler warnings.

Tested on:
    Mac OSX/64 10.8.4 (amazon) w/gcc, C++ & FORTRAN
    (too minor to require h5committest)
2013-08-19 17:13:15 -05:00
Quincey Koziol
453f95c192 [svn-r24011] Description:
Clean up a few warnings

Tested on:
    Mac OSX 10.8.4 (amazon) w/C++ & FORTRAN
    (too minor to require h5committest)
2013-08-15 08:24:28 -05:00
Allen Byrne
4e1695576c [svn-r23953] Update stream handling to allow binary mode - due to unjam fix.
Tested: local linux
2013-07-31 11:22:40 -05:00
Allen Byrne
ad7624ada3 [svn-r23944] Move stream functions into tools lib.
Tested: local linux
2013-07-30 12:04:23 -05:00
Albert Cheng
c2750822ff [svn-r23825] Bug HDFFV-8469: C++ comments in C code.
Found and removed two more "//" comments.

Tested: in Koala by
$ env CFLAGS="-ansi" ../hdf5/bin/buildhdf5 -fortran -cxx -config # enable fortran and cxx, configure only
$ make AM_CFLAGS=-ansi # compile all source file by setting HDF5 build CFLAGS as "-ansi" only
2013-06-26 01:25:44 -05:00
Allen Byrne
125e2a0a9d [svn-r23800] Added the HD prefix to the system functions used in the h5tools_str_replace function. 2013-06-20 17:02:17 -05:00
Allen Byrne
60cce86d0e [svn-r23796] remove commented line with c++ style 2013-06-20 10:06:14 -05:00
Allen Byrne
feb14ea872 [svn-r23745] HDFFV-8461: Add Windows /MT support
This adds the UserMacros.cmake support needed.
2013-06-10 12:46:48 -05:00
Allen Byrne
f0a9b781f3 [svn-r23740] HDFFV-8447: subsetting broke data output file option.
Reviewed in H5T-59, tested local linux
2013-06-07 13:39:54 -05:00
Quincey Koziol
d38fe20df6 [svn-r23695] Description:
Clean up warnings in H5Tconv.c (down to _only_ 9000 lines of output now!)

    Merge changes from Coverity branch back to trunk:

r20684:
Fix for coverity bug #1721 which was due to the fix for coverity bug #943.

r20685:
Use HDstrncpy. --gh

r20761:
Purpose: Fix valgrind issues

Description:
Free image_data and data as appropriate in test_image.

r20762:
Purpose: Fix coverity issue 600

Description:
Add check for return value of H5O_close in H5Ocopy.  Also cleaned up various
warnings.

r20763:
Purpose: Fix valgrind issues with h5stat

Description:
Modified h5stat to free "iter" before exit, and free "hand" before exit if
parse_command_line exits directly.

r20764:
fixed coverity issues:
69, 327, 614, 684, 685, 696, 697, 1681, 967, 826, 660, 80

r20765:
Fixed coverity bug 668

Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning.

No actual integer overflow tests are performed since it's just a test program but I did add a check that n_elements is >= 1.

I also changed an error condition from doing its own close and returning -1 to "goto out;" like the rest of the program.

r20766:
Fixed coverity bug 667

Pulled x * y * z multiply out of malloc operand into a separate n_elements variable to quiet integer overflow warning.

No actual integer overflow tests are performed since it's just a test program.


Tested on:
    Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN
    (h5committest upcoming)
2013-05-11 10:59:48 -05:00
Allen Byrne
4ae0c873e0 [svn-r23446] HDFFV-8344, HDFFV-8346: merge from 1.8 branch 2013-03-25 12:35:39 -05:00
Quincey Koziol
535456397c [svn-r23415] Description:
Avoid using fpclassify() for detecting zero/non-zero values.

Tested on:
    Mac OSX/64 10.8.3 (amazon) w/debug
2013-03-21 13:19:53 -05:00
Quincey Koziol
59dd5665a5 [svn-r23395] Description:
Bring Coverity changes from branch to trunk:

r20682:
fixed coverity:
76, 77, 635, 636, 1164, 1165, 1166, 1121, 1122, 1117, 1343

Tested on:
    Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN
    (too minor to require h5committest)
2013-03-19 22:44:28 -05:00
Allen Byrne
3a4c43cbd4 [svn-r23353] Correct target name 2013-03-15 10:26:14 -05:00
Allen Byrne
aff5c20a6a [svn-r23305] HDFFV-8257: szip still used even if headers are not found. Change configure to test the result of the CHECK HEADERS call before checking for the library.
Tested: local linux, h5committest
2013-02-18 15:56:21 -05:00
Jonathan Kim
dbad502865 [svn-r23304] Purpose:
HDFFV-7643 - h5diff - incorrect exit-code returns for extra attribute exist

Description:
   h5diff: Fixed to return correct exit code 1 when detect unique
   attribute. Prior to this fix, h5diff returned exit code 0 indicating 
   two files are identical.

Tested: 
    jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), fred (mac64-LE), emu (solaris-BE),  Windows (32-LE cmake), cmake (jam)
2013-02-18 14:46:03 -05:00
Allen Byrne
c3e149d06f [svn-r23226] HDFFV-8285: suppress-ddl option: Changed file options to allow for filename F to be optional.
Tested: local linux
2013-02-04 15:15:59 -05:00
Quincey Koziol
a3e98d0e36 [svn-r23219] Description:
Bring reviewed changes from Coverity branch back to trunk (QK & JK):

r20457:
Coverity issue 691: return of H5duo could be negative. Fixed by using
STDOUT_FILENO and redesign parse_command_line and main to cleanup file
allocations. The output_file var is null when using stdout. In cleanup do not
close output_file if NULL.

r20510:
Initialize ufid = -1 and predicate HDclose call on ufid != -1

r20511:
Purpose: Fix coverity issue 1715

Description: Free "file" and nested data on failure in H5FD_core_open.

r20512:
Initialize ifid = -1 and predicate HDclose call on ifid != -1

r20514:
Initialize h5fid = -1 and predicate HDclose call on h5fid != -1

r20516:
Added else branch to the if (ret_value < 0) check.

r20522:
Addressed coverity issues 930-933, 850, 836, 835, 1307.  All minor 
potential buffer overwrite bugs, or coverity errors.  Fixed by replacing
strcpy and sprintf with strncpy and snprintf.

r20523:
fixed coverity issues 68, 1120, 1116i

r20524:
Check  H5Z_SZIP->encoder_present < 1 assuming 0 represents absence.

r20601:
Purpose: Fix coverity issues 1703-1705

Description: Modified the cleanup code in test_free in accum.c to reset
allocated buffers to NULL after they are freed, and modified the error cleanup
code to check if these buffers are NULL before freeing them.  Also fixed some
unrelated warnings in accum.c.

r20602:
Use HDsnprintf and HDstrncat

r20603:
Purpose: Fix coverity issues 808-809

Description: Modified test_core in vfd.c to check the returns from malloc, and
keep track of whether points and check are allocated by setting them to NULL
when they are not.  Added code to free points and check on error if they are
not NULL.  Also fixed unrelated warnings in vfd.c.

r20604:
Use HDstrncpy.

r20605:
Use HDstrncpy and HDstrncat.

r20606:
Purpose: Fix coverity issue 807

Description: Modified long_compact in stab.c to keep track of whether objname is
allocated by setting it to NULL when it is not.  Added code to free objname on
error if it is not NULL.

r20607:
Changed string function calls to use versions that specify the string length
to fix coverity issues 832 and 839.


Tested on:
    Mac OSX/64 10.8.2 (amazon)
    (Too minor to require h5committest)
2013-02-01 20:53:32 -05:00
Allen Byrne
415aa7e257 [svn-r23216] Add newline for special case of only raw data to stdout 2013-01-31 15:51:23 -05:00
Allen Byrne
ff421d9424 [svn-r23190] HDFFV-8285: Add suppress ddl option.
Tested: local linux
2013-01-22 15:43:12 -05:00
Allen Byrne
2fba171a67 [svn-r23160] HDFFV-8227: Mac DARWIN requires CMake 2.8.10 2013-01-14 13:35:30 -05:00
Allen Byrne
7a775b6c59 [svn-r23158] HDFFV-8169: h5dump incorrectly dumps a string into a binary file
Tested: local linux
2013-01-14 11:26:22 -05:00
Quincey Koziol
b9d042d2d2 [svn-r22998] Description:
Clean up warnings and bring changes from Coverity branch back to trunk:

r20451:
Fixed coverity 810

r20454:
Purpose: Fix coverity issue 816

Description: Modified various file drivers to always check the return value from
H5P_get_driver_info.

r20455:
Purpose: Cleanup fix for coverity issue 816

Description: Removed redundant check for "fa" in H5FD_core_open.


Tested on:
    Mac OSX/64 10.8.2 (amazon) w/debug
    (Too minor to require h5committest)
2012-11-01 11:01:37 -05:00
Jonathan Kim
961a24ac3c [svn-r22933] Purpose:
HDFFV-8145 h5diff slowness with version >= 1.8.7

Description:
    Improved speed when comparing HDF5 files with lots of attributes. Much slower performance was identified with release version from 1.8.7 to 1.8.10 compared to 1.8.6.
    
Tested: 
    jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), Windows (32-LE cmake), cmake (jam)
2012-10-19 16:28:14 -05:00
Quincey Koziol
e9519f5e6a [svn-r22921] Description:
Review Coverity changes and bring them back to trunk. (QK & JK)

r20402:
Added #includes for h5tools.y or h5tools_utils.h as required to remedy implicit
function declarations which caused compiler warnings and coverity issues 703-4
and 708-11.

r20414:
This is related to the previous checkin r20399.  There were incorrect updates
which caused incorrect behavior when no file was given. Also possible segfault
when handling hyperslab options. Simplify the code changes.

r20449:
Description: Modified H5E_walk2_cb to check return value of H5I_object_verify.

r20450:
fixed coverity 813


Tested on:
    Mac OSX/64 10.8.2 (amazon) w/C++, FORTRAN, debug & threadsafe
    (too minor to require h5committest)
2012-10-18 14:47:39 -05:00
Larry Knox
33504deb83 [svn-r22908] Reverted changes in revision 22819
Tested with h5committest on jam, koala and ostrich.
2012-10-16 16:38:58 -05:00
Larry Knox
c5371d7618 [svn-r22819] Added H5BLD_STATIC and HDF5_USE_SHLIB to configure.ac so that if configured with --disable-static the default for HDF5_USE_SHLIB in the compile scripts will be changed to yes. This is a fix for HDFFV-8141, where the compile scripts try to link to non-existant static hdf5 libraries.
Tested on jam,koala,ostrich(h5committest) and other THG machines.
2012-09-26 23:49:19 -05:00
Allen Byrne
eff696a3b0 [svn-r22785] HDFFV-8153: Pull POSIX_C_SOURCE define out to separate variable. Use ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) in non-fortran CMakeLists.txt folders
Tested: jam with intel compilers
2012-09-18 17:08:07 -05:00
Jonathan Kim
89a2c4a783 [svn-r22751] Purpose:
HDFFV-5919 -  GMQS: h5diff - The number of object difference is not consistent between dataset and group/type when attribute(s) have differences

Description:
  Object differences are not consistent between dataset and group/datatype when their attribute(s) have differences. This is because attribute(s) differences is not accumulated to group or datatype object’s difference, but accumulated to dataset difference.
  To fix, do not accumulate attribute difference to dataset difference.  This is referred to h5diff’s default behavior and also past report from users that users were confused by the accumulated behavior. (also can’t figure out only for dataset difference , also hard to spot dataset difference when it has lots of attributes or differences)
  This also lead to fix inconsistent format indicating difference between dataset and group/datatype object.

Tested: 
    jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE),  Windows (32-LE cmake), cmake (jam)
2012-09-10 16:40:47 -05:00
Allen Byrne
1f8fb63581 [svn-r22709] HDFFV-8129: reconfigured on jam, Remove overloading of autotools TESTS var, rename configure.in to configure.ac, convert test scripts from hard *.sh to configure managed *sh.in files.
Tested: h5committest
2012-08-23 11:07:43 -05:00
Larry Knox
edf83e5d1f [svn-r22706] Updated autotools: autoconf 2.69, automake 1.12.3, m4 1.4.16, libtool 2.4.2
Tested THG machines.
2012-08-22 00:00:32 -05:00
Jonathan Kim
231fc4d781 [svn-r22684] Purpose:
Address HDFFV-7942 - h5diff: incorrect result for comparing attribute data with different type size in same class

Description:
   When comparing attribute data values with same type class but different size, the result was incorrect.  It was due to the size difference and got truncated. 
   Fixed to match up the smaller type size to big type size like what dataset does.

  
Tested: 
 jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), cmake (jam)
2012-08-15 11:04:26 -05:00
Allen Byrne
9c547117ec [svn-r22637] Remove legacy command to kill MPI processes on obj to obj testing.
Tested: Windows, jam, koala
2012-08-06 15:08:12 -05:00
Allen Byrne
db5a8eaa54 [svn-r22631] Move executable statement to after declarations 2012-08-05 21:48:11 -05:00
Allen Byrne
28943c415b [svn-r22625] HDFFV-8111: h5diff compare file to itself - removed path shortcut 2012-08-03 15:11:36 -05:00
Jonathan Kim
99ef5765f5 [svn-r22618]
Purpose:
  HDFFV-8003 - ph5diff (parallel h5diff): daily test failure on ember intermittently during non comparable test file comparison
  HDFFV-7755 - parallel h5diff : hanging on koala intermittently during non comparable test file comparison

Description:
  non-comparable test intermittently hung on koala and ember, but not on jam. it didn't occur until -np reaches 4 or bigger. it occurred once out of many repeated attempts of the same test.
  There was a incorrectly (mistakenly?) duplicated code in MPI section which caused such hang in a certain condition. The test used more processes than other tests, which increased chance to trigger more undone processes, and such process could enter the incorrect code section and wait for wrong pair of send. it explains why it occurred intermittently according to machine condition and using a certain feature. 
  Removed incorrect code which blocked correct code.
  
Tested: some manually repeated test performed
 jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE)
2012-08-01 12:07:46 -05:00
Allen Byrne
389e928176 [svn-r22604] cast void* to char* for calculation
Issue on windows
2012-07-26 08:32:12 -05:00
Allen Byrne
dd27fe612c [svn-r22602] 2012-07-25 17:17:48 -05:00
Allen Byrne
210d04b05f [svn-r22567] HDFFV-7784: add attributes to the list of file contents option for h5dump. This is accomplished by adding an optional value to the option (-n)
Created test and reference files.

Tested: local linux with cmake
2012-07-12 15:30:30 -05:00
Allen Byrne
b54b3fcf29 [svn-r22563] HDFFV-8095: index order of links wrong
Create setters for indexing options in h5trav.c to be set before the obj table is created. 
Revert h5trav_print to remove now duplicated parameters.
Added test and testfiles.

Tested: local linux with cmake
2012-07-12 10:38:44 -05:00