mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r14402] Description:
Add work-around to allow reading files that were produced with a buggy earlier version of the library, which could create objects with the wrong object header message count. There is now a configure flag "--enable-strict-format-checks" which triggers a failure on reading a file with this sort of corruption (when enabled) and allows the object to be read (when disabled). The default value for the "strict-format-checks" flag is yes when the "debug" flag is enabled and no when the "debug" flag is disabled. Note that if strict format checks are disabled (allowing objects with this particular kind of corruption to be read) and the file is opened with write access, the library will re-write the object header for the corrupt object with the correct # of object header messages. This closes bugzilla bug #1010. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
This commit is contained in:
parent
d9bc27b535
commit
d6e767c21d
MANIFESTMakefile.in
c++
configureconfigure.inexamples
fortran
hl
perform
src
test
testpar
tools
2
MANIFEST
2
MANIFEST
@ -760,6 +760,7 @@
|
||||
./test/fillval.c
|
||||
./test/flush1.c
|
||||
./test/flush2.c
|
||||
./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_bogus.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_cross.c _DO_NOT_DISTRIBUTE_
|
||||
./test/gen_deflate.c _DO_NOT_DISTRIBUTE_
|
||||
@ -803,6 +804,7 @@
|
||||
./test/tarray.c
|
||||
./test/tarrold.h5
|
||||
./test/tattr.c
|
||||
./test/tbad_msg_count.h5
|
||||
./test/tbogus.h5
|
||||
./test/tchecksum.c
|
||||
./test/tconfig.c
|
||||
|
@ -221,6 +221,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -192,6 +192,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -222,6 +222,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -208,6 +208,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
93
configure
vendored
93
configure
vendored
@ -945,6 +945,7 @@ BUILD_ALL_CONDITIONAL_TRUE
|
||||
BUILD_ALL_CONDITIONAL_FALSE
|
||||
DEPRECATED_SYMBOLS
|
||||
DEFAULT_API_VERSION
|
||||
STRICT_FORMAT_CHECKS
|
||||
BUILD_CXX_CONDITIONAL_TRUE
|
||||
BUILD_CXX_CONDITIONAL_FALSE
|
||||
BUILD_PARALLEL_CONDITIONAL_TRUE
|
||||
@ -1616,6 +1617,9 @@ Optional Features:
|
||||
need [default=no]
|
||||
--enable-deprecated-symbols
|
||||
Enable deprecated public API symbols [default=yes]
|
||||
--enable-strict-format-checks
|
||||
Enable strict file format checks, default=yes if
|
||||
debug flag is enabled, no otherwise
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@ -7923,7 +7927,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 7926 "configure"' > conftest.$ac_ext
|
||||
echo '#line 7930 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -10197,11 +10201,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:10200: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:10204: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:10204: \$? = $ac_status" >&5
|
||||
echo "$as_me:10208: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -10465,11 +10469,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:10468: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:10472: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:10472: \$? = $ac_status" >&5
|
||||
echo "$as_me:10476: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -10569,11 +10573,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:10572: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:10576: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:10576: \$? = $ac_status" >&5
|
||||
echo "$as_me:10580: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -12949,7 +12953,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 12952 "configure"
|
||||
#line 12956 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13049,7 +13053,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 13052 "configure"
|
||||
#line 13056 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -15401,11 +15405,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15404: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15408: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15408: \$? = $ac_status" >&5
|
||||
echo "$as_me:15412: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -15505,11 +15509,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15508: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15512: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:15512: \$? = $ac_status" >&5
|
||||
echo "$as_me:15516: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -17075,11 +17079,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:17078: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:17082: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:17082: \$? = $ac_status" >&5
|
||||
echo "$as_me:17086: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -17179,11 +17183,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:17182: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:17186: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:17186: \$? = $ac_status" >&5
|
||||
echo "$as_me:17190: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -19377,11 +19381,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19380: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19384: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:19384: \$? = $ac_status" >&5
|
||||
echo "$as_me:19388: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -19645,11 +19649,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19648: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19652: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:19652: \$? = $ac_status" >&5
|
||||
echo "$as_me:19656: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@ -19749,11 +19753,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:19752: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:19756: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:19756: \$? = $ac_status" >&5
|
||||
echo "$as_me:19760: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -52088,6 +52092,43 @@ echo "$as_me: error: Removing old public API symbols not allowed when using them
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ echo "$as_me:$LINENO: checking Whether to perform strict file format checks" >&5
|
||||
echo $ECHO_N "checking Whether to perform strict file format checks... $ECHO_C" >&6; };
|
||||
# Check whether --enable-strict-format-checks was given.
|
||||
if test "${enable_strict_format_checks+set}" = set; then
|
||||
enableval=$enable_strict_format_checks; STRICT_CHECKS=$enableval
|
||||
fi
|
||||
|
||||
|
||||
if test "X-$STRICT_CHECKS" = X- ; then
|
||||
if test -z "$DEBUG_PKG" ; then
|
||||
STRICT_CHECKS=no
|
||||
else
|
||||
STRICT_CHECKS=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
case "X-$STRICT_CHECKS" in
|
||||
X-yes)
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
STRICT_FORMAT_CHECKS=yes
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define STRICT_FORMAT_CHECKS 1
|
||||
_ACEOF
|
||||
|
||||
;;
|
||||
X-no|*)
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
STRICT_FORMAT_CHECKS=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
if test "X$HDF_CXX" = "Xyes"; then
|
||||
BUILD_CXX_CONDITIONAL_TRUE=
|
||||
BUILD_CXX_CONDITIONAL_FALSE='#'
|
||||
@ -53143,6 +53184,7 @@ BUILD_ALL_CONDITIONAL_TRUE!$BUILD_ALL_CONDITIONAL_TRUE$ac_delim
|
||||
BUILD_ALL_CONDITIONAL_FALSE!$BUILD_ALL_CONDITIONAL_FALSE$ac_delim
|
||||
DEPRECATED_SYMBOLS!$DEPRECATED_SYMBOLS$ac_delim
|
||||
DEFAULT_API_VERSION!$DEFAULT_API_VERSION$ac_delim
|
||||
STRICT_FORMAT_CHECKS!$STRICT_FORMAT_CHECKS$ac_delim
|
||||
BUILD_CXX_CONDITIONAL_TRUE!$BUILD_CXX_CONDITIONAL_TRUE$ac_delim
|
||||
BUILD_CXX_CONDITIONAL_FALSE!$BUILD_CXX_CONDITIONAL_FALSE$ac_delim
|
||||
BUILD_PARALLEL_CONDITIONAL_TRUE!$BUILD_PARALLEL_CONDITIONAL_TRUE$ac_delim
|
||||
@ -53157,7 +53199,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
@ -53953,6 +53995,9 @@ IF_ENABLED_DISABLED "$CODESTACK"
|
||||
PRINT_N " GPFS"
|
||||
IF_YES_NO "$GPFS"
|
||||
|
||||
PRINT_N " Strict File Format Checks"
|
||||
IF_ENABLED_DISABLED "$STRICT_FORMAT_CHECKS"
|
||||
|
||||
PRINT_N " Default API Mapping"
|
||||
PRINT "$DEFAULT_API_VERSION"
|
||||
|
||||
|
38
configure.in
38
configure.in
@ -3645,6 +3645,41 @@ if test "X${DEFAULT_API_VERSION}" != "Xv18" -a "X${DEPRECATED_SYMBOLS}" = "Xno"
|
||||
AC_MSG_ERROR([Removing old public API symbols not allowed when using them as default public API symbols])
|
||||
fi
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Enable strict file format checks
|
||||
dnl
|
||||
AC_SUBST([STRICT_FORMAT_CHECKS])
|
||||
AC_MSG_CHECKING([Whether to perform strict file format checks]);
|
||||
AC_ARG_ENABLE([strict-format-checks],
|
||||
[AC_HELP_STRING([--enable-strict-format-checks],
|
||||
[Enable strict file format checks, default=yes if
|
||||
debug flag is enabled, no otherwise])],
|
||||
[STRICT_CHECKS=$enableval])
|
||||
|
||||
dnl Default to yes if debug is enabled
|
||||
if test "X-$STRICT_CHECKS" = X- ; then
|
||||
if test -z "$DEBUG_PKG" ; then
|
||||
STRICT_CHECKS=no
|
||||
else
|
||||
STRICT_CHECKS=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
case "X-$STRICT_CHECKS" in
|
||||
X-yes)
|
||||
AC_MSG_RESULT([yes])
|
||||
STRICT_FORMAT_CHECKS=yes
|
||||
AC_DEFINE([STRICT_FORMAT_CHECKS], [1],
|
||||
[Define if strict file format checks are enabled])
|
||||
;;
|
||||
X-no|*)
|
||||
AC_MSG_RESULT([no])
|
||||
STRICT_FORMAT_CHECKS=no
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Create automake conditionals to tell automake makefiles which directories
|
||||
dnl need to be compiled
|
||||
@ -3952,6 +3987,9 @@ IF_ENABLED_DISABLED "$CODESTACK"
|
||||
PRINT_N " GPFS"
|
||||
IF_YES_NO "$GPFS"
|
||||
|
||||
PRINT_N " Strict File Format Checks"
|
||||
IF_ENABLED_DISABLED "$STRICT_FORMAT_CHECKS"
|
||||
|
||||
PRINT_N " Default API Mapping"
|
||||
PRINT "$DEFAULT_API_VERSION"
|
||||
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -196,6 +196,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -249,6 +249,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -242,6 +242,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -199,6 +199,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -196,6 +196,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -192,6 +192,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -211,6 +211,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -202,6 +202,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -196,6 +196,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -186,6 +186,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -216,6 +216,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -206,6 +206,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -212,6 +212,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -222,6 +222,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -193,6 +193,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -214,6 +214,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -237,6 +237,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -1077,6 +1077,14 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
|
||||
oh->version = H5O_VERSION_1;
|
||||
oh->sizeof_size = H5F_SIZEOF_SIZE(f);
|
||||
oh->sizeof_addr = H5F_SIZEOF_ADDR(f);
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
/* Check whether the "bad message count" property is set */
|
||||
if(H5P_exist_plist(oc_plist, H5O_BAD_MESG_COUNT_NAME) > 0) {
|
||||
/* Retrieve bad message count flag */
|
||||
if(H5P_get(oc_plist, H5O_BAD_MESG_COUNT_NAME, &oh->store_bad_mesg_count) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get bad message count flag")
|
||||
} /* end if */
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
|
||||
/* Set initial status flags */
|
||||
oh->flags = oh_flags;
|
||||
|
@ -580,10 +580,25 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1,
|
||||
if(merged_null_msgs)
|
||||
oh->cache_info.is_dirty = TRUE;
|
||||
|
||||
/* Don't check for the incorrect # of object header messages bug unless we've
|
||||
* enabled strict format checking. This allows for older files, created with
|
||||
* a version of the library that had a bug in tracking the correct # of header
|
||||
* messages to be read in without the library fussing about things. -QAK
|
||||
*/
|
||||
#ifdef H5_STRICT_FORMAT_CHECKS
|
||||
/* Sanity check for the correct # of messages in object header */
|
||||
if(oh->version == H5O_VERSION_1)
|
||||
if((oh->nmesgs + merged_null_msgs) != nmesgs)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "corrupt object header - too few messages")
|
||||
#else /* H5_STRICT_FORMAT_CHECKS */
|
||||
/* Check for incorrect # of messages in object header and if we have write
|
||||
* access on the file, flag the object header as dirty, so it gets fixed.
|
||||
*/
|
||||
if(oh->version == H5O_VERSION_1)
|
||||
if((oh->nmesgs + merged_null_msgs) != nmesgs &&
|
||||
(H5F_get_intent(f) & H5F_ACC_RDWR))
|
||||
oh->cache_info.is_dirty = TRUE;
|
||||
#endif /* H5_STRICT_FORMAT_CHECKS */
|
||||
|
||||
#ifdef H5O_DEBUG
|
||||
H5O_assert(oh);
|
||||
@ -710,7 +725,12 @@ H5O_assert(oh);
|
||||
*p++ = 0;
|
||||
|
||||
/* Number of messages */
|
||||
UINT16ENCODE(p, oh->nmesgs);
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
if(oh->store_bad_mesg_count)
|
||||
UINT16ENCODE(p, (oh->nmesgs - 1))
|
||||
else
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
UINT16ENCODE(p, oh->nmesgs);
|
||||
|
||||
/* Link count */
|
||||
UINT32ENCODE(p, oh->nlink);
|
||||
|
@ -253,6 +253,12 @@ struct H5O_t {
|
||||
/* File-specific information (not stored) */
|
||||
size_t sizeof_size; /* Size of file sizes */
|
||||
size_t sizeof_addr; /* Size of file addresses */
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
hbool_t store_bad_mesg_count; /* Flag to indicate that a bad message count should be stored */
|
||||
/* (This is to simulate a bug in earlier
|
||||
* versions of the library)
|
||||
*/
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
|
||||
/* Object information (stored) */
|
||||
hbool_t has_refcount_msg; /* Whether the object has a ref. count message */
|
||||
|
@ -91,6 +91,10 @@ typedef struct H5O_t H5O_t;
|
||||
#define H5O_BOGUS_MSG_FLAGS_NAME "bogus msg flags" /* Flags for 'bogus' message */
|
||||
#define H5O_BOGUS_MSG_FLAGS_SIZE sizeof(uint8_t)
|
||||
#endif /* H5O_ENABLE_BOGUS */
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
#define H5O_BAD_MESG_COUNT_NAME "bad message count" /* Flag setting bad message count */
|
||||
#define H5O_BAD_MESG_COUNT_SIZE sizeof(hbool_t)
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
|
||||
/* ========= Object Copy properties ============ */
|
||||
#define H5O_CPY_OPTION_NAME "copy object" /* Copy options */
|
||||
|
@ -570,6 +570,9 @@
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if strict file format checks are enabled */
|
||||
#undef STRICT_FORMAT_CHECKS
|
||||
|
||||
/* Define if your system supports pthread_attr_setscope(&attribute,
|
||||
PTHREAD_SCOPE_SYSTEM) call. */
|
||||
#undef SYSTEM_SCOPE_THREADS
|
||||
|
@ -269,6 +269,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -59,7 +59,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat testmeta
|
||||
# --enable-build-all at configure time.
|
||||
# The gen_old_* files can only be compiled with older versions of the library
|
||||
# so do not appear in this list.
|
||||
BUILD_ALL_PROGS=gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
|
||||
BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
|
||||
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
|
||||
gen_nullspace gen_udlinks space_overflow
|
||||
|
||||
|
@ -81,8 +81,8 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
|
||||
vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
|
||||
dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \
|
||||
btree2$(EXEEXT) fheap$(EXEEXT)
|
||||
am__EXEEXT_2 = gen_bogus$(EXEEXT) gen_cross$(EXEEXT) \
|
||||
gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \
|
||||
am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \
|
||||
gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \
|
||||
gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \
|
||||
gen_new_group$(EXEEXT) gen_new_mtime$(EXEEXT) \
|
||||
gen_new_super$(EXEEXT) gen_noencoder$(EXEEXT) \
|
||||
@ -173,6 +173,10 @@ flush2_SOURCES = flush2.c
|
||||
flush2_OBJECTS = flush2.$(OBJEXT)
|
||||
flush2_LDADD = $(LDADD)
|
||||
flush2_DEPENDENCIES = libh5test.la $(LIBHDF5)
|
||||
gen_bad_ohdr_SOURCES = gen_bad_ohdr.c
|
||||
gen_bad_ohdr_OBJECTS = gen_bad_ohdr.$(OBJEXT)
|
||||
gen_bad_ohdr_LDADD = $(LDADD)
|
||||
gen_bad_ohdr_DEPENDENCIES = libh5test.la $(LIBHDF5)
|
||||
gen_bogus_SOURCES = gen_bogus.c
|
||||
gen_bogus_OBJECTS = gen_bogus.$(OBJEXT)
|
||||
gen_bogus_LDADD = $(LDADD)
|
||||
@ -331,24 +335,26 @@ SOURCES = $(libh5test_la_SOURCES) big.c bittests.c btree2.c cache.c \
|
||||
cache_api.c cmpd_dset.c cross_read.c dangle.c dsets.c \
|
||||
dt_arith.c dtransform.c dtypes.c enum.c err_compat.c \
|
||||
error_test.c extend.c external.c fheap.c fillval.c flush1.c \
|
||||
flush2.c gen_bogus.c gen_cross.c gen_deflate.c gen_filters.c \
|
||||
gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \
|
||||
gen_new_super.c gen_noencoder.c gen_nullspace.c gen_udlinks.c \
|
||||
getname.c gheap.c hyperslab.c istore.c lheap.c links.c mount.c \
|
||||
mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \
|
||||
set_extent.c space_overflow.c stab.c $(testhdf5_SOURCES) \
|
||||
testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c
|
||||
flush2.c gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
|
||||
gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
|
||||
gen_new_mtime.c gen_new_super.c gen_noencoder.c \
|
||||
gen_nullspace.c gen_udlinks.c getname.c gheap.c hyperslab.c \
|
||||
istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c \
|
||||
ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \
|
||||
$(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
|
||||
vfd.c
|
||||
DIST_SOURCES = $(libh5test_la_SOURCES) big.c bittests.c btree2.c \
|
||||
cache.c cache_api.c cmpd_dset.c cross_read.c dangle.c dsets.c \
|
||||
dt_arith.c dtransform.c dtypes.c enum.c err_compat.c \
|
||||
error_test.c extend.c external.c fheap.c fillval.c flush1.c \
|
||||
flush2.c gen_bogus.c gen_cross.c gen_deflate.c gen_filters.c \
|
||||
gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \
|
||||
gen_new_super.c gen_noencoder.c gen_nullspace.c gen_udlinks.c \
|
||||
getname.c gheap.c hyperslab.c istore.c lheap.c links.c mount.c \
|
||||
mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \
|
||||
set_extent.c space_overflow.c stab.c $(testhdf5_SOURCES) \
|
||||
testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c
|
||||
flush2.c gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
|
||||
gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
|
||||
gen_new_mtime.c gen_new_super.c gen_noencoder.c \
|
||||
gen_nullspace.c gen_udlinks.c getname.c gheap.c hyperslab.c \
|
||||
istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c \
|
||||
ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \
|
||||
$(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
|
||||
vfd.c
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@ -470,6 +476,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
@ -631,7 +638,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api \
|
||||
# --enable-build-all at configure time.
|
||||
# The gen_old_* files can only be compiled with older versions of the library
|
||||
# so do not appear in this list.
|
||||
BUILD_ALL_PROGS = gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
|
||||
BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
|
||||
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
|
||||
gen_nullspace gen_udlinks space_overflow
|
||||
|
||||
@ -798,6 +805,9 @@ flush1$(EXEEXT): $(flush1_OBJECTS) $(flush1_DEPENDENCIES)
|
||||
flush2$(EXEEXT): $(flush2_OBJECTS) $(flush2_DEPENDENCIES)
|
||||
@rm -f flush2$(EXEEXT)
|
||||
$(LINK) $(flush2_OBJECTS) $(flush2_LDADD) $(LIBS)
|
||||
gen_bad_ohdr$(EXEEXT): $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_DEPENDENCIES)
|
||||
@rm -f gen_bad_ohdr$(EXEEXT)
|
||||
$(LINK) $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_LDADD) $(LIBS)
|
||||
gen_bogus$(EXEEXT): $(gen_bogus_OBJECTS) $(gen_bogus_DEPENDENCIES)
|
||||
@rm -f gen_bogus$(EXEEXT)
|
||||
$(LINK) $(gen_bogus_OBJECTS) $(gen_bogus_LDADD) $(LIBS)
|
||||
@ -926,6 +936,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fillval.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bad_ohdr.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bogus.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_cross.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_deflate.Po@am__quote@
|
||||
|
103
test/gen_bad_ohdr.c
Normal file
103
test/gen_bad_ohdr.c
Normal file
@ -0,0 +1,103 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Programmer: Quincey Koziol <koziol@hdfgroup.org>
|
||||
* Jan 5, 2008
|
||||
*
|
||||
* Purpose: This program is run to generate an HDF5 data file with a
|
||||
* root group that contains the incorrect # of object header
|
||||
* messages. It must be built/run with a copy of the library
|
||||
* that has been built with the "H5O_ENABLE_BAD_MESG_COUNT" macro
|
||||
* defined.
|
||||
*/
|
||||
|
||||
#include "hdf5.h"
|
||||
#include "H5private.h"
|
||||
#include "H5Oprivate.h"
|
||||
|
||||
#define FILENAME "tbad_msg_count.h5"
|
||||
#define GROUPNAME "Group"
|
||||
#define ATTRNAME1 "Attribute #1"
|
||||
#define ATTRNAME2 "Attribute #2"
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif /* TRUE */
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif /* FALSE */
|
||||
|
||||
int main(void)
|
||||
{
|
||||
#ifdef H5O_ENABLE_BAD_MESG_COUNT
|
||||
hid_t fid = -1; /* File ID */
|
||||
hid_t gid = -1; /* Group ID */
|
||||
hid_t sid = -1; /* Dataspace ID */
|
||||
hid_t aid = -1; /* Attribute ID */
|
||||
hid_t gcpl = -1; /* Group creation property list ID */
|
||||
hbool_t store_bad_mesg_count; /* Flag for storing a bad message count */
|
||||
|
||||
/* Create test file */
|
||||
if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
|
||||
|
||||
/* Create group creation property list */
|
||||
if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error;
|
||||
|
||||
/* Add property for storing bad message count */
|
||||
store_bad_mesg_count = TRUE;
|
||||
if(H5Pinsert2(gcpl, H5O_BAD_MESG_COUNT_NAME, H5O_BAD_MESG_COUNT_SIZE, &store_bad_mesg_count, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error;
|
||||
|
||||
/* Create group with bad object header message count */
|
||||
if((gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error;
|
||||
|
||||
/* Close group creation property list */
|
||||
if(H5Pclose(gcpl) < 0) goto error;
|
||||
|
||||
/* Create dataspace for attributes */
|
||||
if((sid = H5Screate(H5S_SCALAR)) < 0) goto error;
|
||||
|
||||
/* Create attribute on root group */
|
||||
if((aid = H5Acreate2(gid, ATTRNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
|
||||
if(H5Aclose(aid) < 0) goto error;
|
||||
|
||||
/* Create another attribute on root group */
|
||||
if((aid = H5Acreate2(gid, ATTRNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
|
||||
if(H5Aclose(aid) < 0) goto error;
|
||||
|
||||
/* Close dataspace */
|
||||
if(H5Sclose(sid) < 0) goto error;
|
||||
|
||||
/* Close group */
|
||||
if(H5Gclose(gid) < 0) goto error;
|
||||
|
||||
/* Close file */
|
||||
if(H5Fclose(fid) < 0) goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(aid);
|
||||
H5Sclose(sid);
|
||||
H5Pclose(gcpl);
|
||||
H5Fclose(fid);
|
||||
} H5E_END_TRY;
|
||||
#else /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
HDputs("H5O_BAD_MESG_COUNT compiler macro not defined!");
|
||||
#endif /* H5O_ENABLE_BAD_MESG_COUNT */
|
||||
return 1;
|
||||
}
|
||||
|
BIN
test/tbad_msg_count.h5
Normal file
BIN
test/tbad_msg_count.h5
Normal file
Binary file not shown.
61
test/tmisc.c
61
test/tmisc.c
@ -295,6 +295,11 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset
|
||||
/* Definitions for misc. test #26 */
|
||||
#define MISC26_FILE "dcpl_file"
|
||||
|
||||
/* Definitions for misc. test #27 */
|
||||
/* (Note that this test file is generated by the "gen_bad_ohdr.c" code) */
|
||||
#define MISC27_FILE "tbad_msg_count.h5"
|
||||
#define MISC27_GROUP "Group"
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_misc1(): test unlinking a dataset from a group and immediately
|
||||
@ -1709,7 +1714,7 @@ test_misc10(void)
|
||||
hid_t dcpl; /* Dataset creation property list */
|
||||
hid_t space, type; /* Old dataset's dataspace & datatype */
|
||||
char testfile[512]=""; /* Character buffer for corrected test file name */
|
||||
char *srcdir = getenv("srcdir"); /* Pointer to the directory the source code is located within */
|
||||
char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
|
||||
herr_t ret;
|
||||
|
||||
/* Output message about test being performed */
|
||||
@ -4796,6 +4801,59 @@ test_misc26(void)
|
||||
CHECK_I(ret, "H5Pclose");
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_misc27(): Ensure that objects with incorrect # of object
|
||||
** header messages are handled appropriately.
|
||||
**
|
||||
** (Note that this test file is generated by the "gen_bad_ohdr.c" code)
|
||||
**
|
||||
****************************************************************/
|
||||
static void
|
||||
test_misc27(void)
|
||||
{
|
||||
hid_t fid; /* File ID */
|
||||
hid_t gid; /* Group ID */
|
||||
char testfile[512]=""; /* Character buffer for corrected test file name */
|
||||
char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Corrupt object header handling\n"));
|
||||
|
||||
/* Generate the correct name for the test file, by prepending the source path */
|
||||
if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC27_FILE) + 1) < sizeof(testfile))) {
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
HDstrcat(testfile, MISC27_FILE);
|
||||
|
||||
/* Open the file */
|
||||
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
CHECK(fid, FAIL, "H5Fopen");
|
||||
|
||||
#ifdef H5_STRICT_FORMAT_CHECKS
|
||||
/* Open group with incorrect # of object header messages (should fail) */
|
||||
H5E_BEGIN_TRY {
|
||||
gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
VERIFY(gid, FAIL, "H5Gopen2");
|
||||
#else /* H5_STRICT_FORMAT_CHECKS */
|
||||
/* Open group with incorrect # of object header messages */
|
||||
gid = H5Gopen2(fid, MISC27_GROUP, H5P_DEFAULT);
|
||||
CHECK(gid, FAIL, "H5Gopen2");
|
||||
|
||||
/* Close group */
|
||||
ret = H5Gclose(gid);
|
||||
CHECK(ret, FAIL, "H5Gclose");
|
||||
#endif /* H5_STRICT_FORMAT_CHECKS */
|
||||
|
||||
/* Close file */
|
||||
ret = H5Fclose(fid);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
} /* end test_misc27() */
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_misc(): Main misc. test routine.
|
||||
@ -4837,6 +4895,7 @@ test_misc(void)
|
||||
test_misc25b(); /* Exercise null object header message merge bug on existing file */
|
||||
test_misc25c(); /* Exercise another null object header message merge bug */
|
||||
test_misc26(); /* Test closing property lists with long filter pipelines */
|
||||
test_misc27(); /* Test opening file with object that has bad # of object header messages */
|
||||
|
||||
|
||||
} /* test_misc() */
|
||||
|
@ -229,6 +229,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -193,6 +193,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -210,6 +210,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -217,6 +217,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -215,6 +215,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -210,6 +210,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -221,6 +221,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -204,6 +204,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -224,6 +224,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -213,6 +213,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -209,6 +209,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
@ -228,6 +228,7 @@ SET_MAKE = @SET_MAKE@
|
||||
SHELL = /bin/sh
|
||||
SIZE_T = @SIZE_T@
|
||||
STATIC_SHARED = @STATIC_SHARED@
|
||||
STRICT_FORMAT_CHECKS = @STRICT_FORMAT_CHECKS@
|
||||
STRIP = @STRIP@
|
||||
TESTPARALLEL = @TESTPARALLEL@
|
||||
TIME = @TIME@
|
||||
|
Loading…
x
Reference in New Issue
Block a user