Crash reported with CORE driver

Hi,

I had a user recently report crash when using the CORE file driver
with backing store, with HDF5 1.8.7 on OS X (10.6). The Python
snippet used to create the file was:

import h5py
import numpy as np

bs = 1024 * 1024
f = h5py.File('myfile.hdf5', driver='core', backing_store=True)
for ct in range(2000):
    print ct
    dset = f.create_dataset("MyDataset%d" % ct, (bs ,), 'd')
    dset[...] = np.random.uniform(0, 1, (bs,))

resulting in:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000000000052c
0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
1754 if(f->shared->fc_degree == H5F_CLOSE_SEMI) {
(gdb) where
#0 0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
#1 0x0000000100538e6b in H5I_clear_type (type=<value temporarily
unavailable, due to optimizations>, force=0, app_ref=0) at H5I.c:599

(gdb) p f
$1 = (H5F_t *) 0x1014d8e20
(gdb) p f->shared
$2 = (H5F_file_t *) 0x0
(gdb)

I've been over the Python side and can't find anything obviously wrong
in h5py. Unfortunately I am also having problems reproducing it on my
setup. Have there been any reports of problems when closing CORE
files?

Andrew

Hi Andrew,

···

On Oct 8, 2011, at 2:43 PM, Andrew Collette wrote:

Hi,

I had a user recently report crash when using the CORE file driver
with backing store, with HDF5 1.8.7 on OS X (10.6). The Python
snippet used to create the file was:

import h5py
import numpy as np

bs = 1024 * 1024
f = h5py.File('myfile.hdf5', driver='core', backing_store=True)
for ct in range(2000):
   print ct
   dset = f.create_dataset("MyDataset%d" % ct, (bs ,), 'd')
   dset[...] = np.random.uniform(0, 1, (bs,))

resulting in:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000000000052c
0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
1754 if(f->shared->fc_degree == H5F_CLOSE_SEMI) {
(gdb) where
#0 0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
#1 0x0000000100538e6b in H5I_clear_type (type=<value temporarily
unavailable, due to optimizations>, force=0, app_ref=0) at H5I.c:599

(gdb) p f
$1 = (H5F_t *) 0x1014d8e20
(gdb) p f->shared
$2 = (H5F_file_t *) 0x0
(gdb)

I've been over the Python side and can't find anything obviously wrong
in h5py. Unfortunately I am also having problems reproducing it on my
setup. Have there been any reports of problems when closing CORE
files?

  Hmm, nothing that I can recall with the CORE driver... Can you duplicate something in C?

  Quincey

Hi Quincey,

       Hmm, nothing that I can recall with the CORE driver... Can you duplicate something in C?

I can't duplicate the problem on my machine, but the user was able to
compile and run the attached C program. FYI he has only 8GB of
physical ram, so the crash may be related to memory exhaustion.

His platform is:
OS 10.6, HDF5 1.8.7

Thanks,
Andrew

Program output:

HDF5-DIAG: Error detected in HDF5 (1.8.7) thread 140735089405120:
  #000: H5F.c line 1991 in H5Fclose(): decrementing file ID failed
    major: Object atom
    minor: Unable to close file
  #001: H5I.c line 1450 in H5I_dec_app_ref(): can't decrement ID ref count
    major: Object atom
    minor: Unable to decrement reference count
  #002: H5F.c line 1775 in H5F_close(): can't close file
    major: File accessability
    minor: Unable to close file
  #003: H5F.c line 1930 in H5F_try_close(): problems closing file
    major: File accessability
    minor: Unable to close file
  #004: H5F.c line 1088 in H5F_dest(): unable to close file
    major: File accessability
    minor: Unable to close file
  #005: H5FD.c line 1197 in H5FD_close(): close failed
    major: Virtual File Layer
    minor: Unable to close file
  #006: H5FDcore.c line 545 in H5FD_core_close(): unable to flush file
    major: File accessability
    minor: Unable to flush data from cache
  #007: H5FDcore.c line 1047 in H5FD_core_flush(): error writing backing store
    major: Low-level I/O
    minor: Write failed
  #008: H5F.c line 1006 in H5F_dest(): unable to flush cache
    major: Object cache
    minor: Unable to flush data from cache
  #009: H5F.c line 1710 in H5F_flush(): low level flush failed
    major: Low-level I/O
    minor: Write failed
  #010: H5FD.c line 1894 in H5FD_flush(): driver flush request failed
    major: Virtual File Layer
    minor: Unable to initialize object
  #011: H5FDcore.c line 1047 in H5FD_core_flush(): error writing backing store
    major: Low-level I/O
    minor: Write failed
Closing other objects...
Segmentation fault

GDB backtrace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000000000052c
0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
1754 if(f->shared->fc_degree == H5F_CLOSE_SEMI) {
(gdb) where
#0 0x00000001004de76e in H5F_close (f=0x1014d8e20) at H5F.c:1754
#1 0x0000000100538e6b in H5I_clear_type (type=<value temporarily
unavailable, due to optimizations>, force=0, app_ref=0) at H5I.c:599

(gdb) p f
$1 = (H5F_t *) 0x1014d8e20
(gdb) p f->shared
$2 = (H5F_file_t *) 0x0
(gdb)

test.c (1.45 KB)