diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2013-05-14 19:56:51 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2013-05-14 19:56:51 (GMT) |
commit | 71af5b7480cb0f0aa689640972f8e96fef1e60f0 (patch) | |
tree | ab8e74253d276931a20d40a0df8a2de6692026fe /test | |
parent | 811ac68ac24972a1392fc9f6d20ae96286b2db7a (diff) | |
download | hdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.zip hdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.tar.gz hdf5-71af5b7480cb0f0aa689640972f8e96fef1e60f0.tar.bz2 |
[svn-r23702] Issue 8380 - H5Zunregister caused seg fault. This is a porting of code from the trunk. It fixes the problem by first iterating
through all opened datasets and groups to see if any of them uses the filter. If it finds one, the function fails with a message.
Then the function flushes all opened files.
Tested with h5committest.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 19 |
3 files changed, 20 insertions, 7 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e4530e0..0bac62d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -354,6 +354,8 @@ ADD_TEST ( testmeta.h5 tstint1.h5 tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 ) SET (H5_TESTS @@ -406,6 +408,7 @@ SET (H5_TESTS testmeta #links_env file_image + unregister ) FOREACH (test ${H5_TESTS}) @@ -664,6 +667,7 @@ IF (HDF5_TEST_VFD) tcheck_version testmeta links_env + unregister ) IF (DIRECT_VFD) diff --git a/test/Makefile.am b/test/Makefile.am index 15a2668..6b23566 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -46,7 +46,7 @@ TEST_PROG=testhdf5 lheap ohdr stab gheap cache cache_api \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe \ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf btree2 fheap file_image + freespace mf btree2 fheap file_image unregister # List programs to be built when testing here. error_test and err_compat are # built at the same time as the other tests, but executed by testerror.sh. @@ -150,7 +150,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse tcheck_version_*.err efc[0-5].h5 log_vfd_out.log \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy + file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/Makefile.in b/test/Makefile.in index 5d21a16..9b765f7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -163,7 +163,7 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \ dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \ freespace$(EXEEXT) mf$(EXEEXT) btree2$(EXEEXT) fheap$(EXEEXT) \ - file_image$(EXEEXT) + file_image$(EXEEXT) unregister$(EXEEXT) @HAVE_SHARED_CONDITIONAL_TRUE@am__EXEEXT_2 = plugin$(EXEEXT) am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \ @@ -452,6 +452,10 @@ unlink_SOURCES = unlink.c unlink_OBJECTS = unlink.$(OBJEXT) unlink_LDADD = $(LDADD) unlink_DEPENDENCIES = libh5test.la $(LIBHDF5) +unregister_SOURCES = unregister.c +unregister_OBJECTS = unregister.$(OBJEXT) +unregister_LDADD = $(LDADD) +unregister_DEPENDENCIES = libh5test.la $(LIBHDF5) vfd_SOURCES = vfd.c vfd_OBJECTS = vfd.$(OBJEXT) vfd_LDADD = $(LDADD) @@ -505,7 +509,7 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ ohdr.c plugin.c pool.c reserved.c set_extent.c \ space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c + testmeta.c $(ttsafe_SOURCES) unlink.c unregister.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ $(am__libdynlib2_la_SOURCES_DIST) \ $(am__libdynlib3_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ @@ -522,7 +526,7 @@ DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ ohdr.c plugin.c pool.c reserved.c set_extent.c \ space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c + testmeta.c $(ttsafe_SOURCES) unlink.c unregister.c vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -844,7 +848,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ tcheck_version_*.out tcheck_version_*.err efc[0-5].h5 \ log_vfd_out.log new_multi_file_v16-r.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ - split_get_file_image_test-r.h5 file_image_core_test.h5.copy + split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ + unregister_filter_1.h5 unregister_filter_2.h5 INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat @@ -867,7 +872,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe \ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf btree2 fheap file_image + freespace mf btree2 fheap file_image unregister # These programs generate test files for the tests. They don't need to be @@ -1247,6 +1252,9 @@ ttsafe$(EXEEXT): $(ttsafe_OBJECTS) $(ttsafe_DEPENDENCIES) $(EXTRA_ttsafe_DEPENDE unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) @rm -f unlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) +unregister$(EXEEXT): $(unregister_OBJECTS) $(unregister_DEPENDENCIES) $(EXTRA_unregister_DEPENDENCIES) + @rm -f unregister$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unregister_OBJECTS) $(unregister_LDADD) $(LIBS) vfd$(EXEEXT): $(vfd_OBJECTS) $(vfd_DEPENDENCIES) $(EXTRA_vfd_DEPENDENCIES) @rm -f vfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vfd_OBJECTS) $(vfd_LDADD) $(LIBS) @@ -1358,6 +1366,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvlstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvltypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unregister.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfd.Po@am__quote@ .c.o: |