Skip to content
Novus Examples
h51 KB

Intentionally Corrupt HDF5 — Truncated After the Superblock (.h5)

An intentionally corrupt HDF5 file cut to 1024 bytes, so the 8-byte signature and superblock survive while the object headers and B-trees they point at do not. Format sniffing will say HDF5 and opening must fail loudly, which is exactly the split this fixture measures.

Preview — schema + first 5 rowsh5
FieldValue
Damageintentionally corrupt — truncated to 1024 bytes
Original size14712 bytes
Signatureintact: \x89HDF\r\n\x1a\n at offset 0
Superblockpresent, but the B-tree and object headers it points at are gone
Expected behaviourthe open fails with a clear HDF5 error
Intentionally corrupt: the 8-byte HDF5 signature survives, nothing it references does.

Specifications

Intentionally Corrupt
true
Damage
truncated to the first 1024 bytes
Original Bytes
14712
Kept Bytes
1024
Signature Intact
true
Object Headers Present
false

Testing contract

Expected to fail
Scenario
Sniff the file signature, then attempt to open it with an HDF5 library and list the root group.
Expected result
The first eight bytes match the HDF5 signature, but h5py or libhdf5 raises an explicit truncated-file or bad-object-header error rather than returning an empty root group.

What is a .h5 file?

HDF5 (.h5) is a binary container format for large, heterogeneous scientific data. It stores multidimensional arrays (datasets) in a hierarchical group structure with attributes and chunked, compressed storage, and is standard in ML, physics, and geoscience.

How to use this file

Use an example .h5 file to test HDF5 readers (h5py, PyTables), group and dataset traversal, and attribute extraction.

How to use this file for testing

“Intentionally Corrupt HDF5 — Truncated After the Superblock (.h5)” is a deterministic Novus Examples fixture for Scientific data, Error handling. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: damage: truncated to the first 1024 bytes · intentionally corrupt. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required — license.