Skip to content

ReadDREAM3DFilter crashes when a Geometry is nested inside a DataGroup #1642

Description

@imikejackson

Summary

ReadDREAM3DFilter (and the DREAM3D-NX GUI) crashes when reading a .dream3d file that
contains a Geometry nested inside a DataGroup. The same geometry written at the top
level of the DataStructure reads back fine. WriteDREAM3DFilter writes the nested-geometry
file without any error, so this is a write/read asymmetry.

Environment

  • simplnx Python bindings (conda env), HDF5 1.14.6
  • Reproduced both via ReadDREAM3DFilter from Python and by opening the file in DREAM3D-NX

Steps to reproduce

import numpy as np, simplnx as nx

ds = nx.DataStructure()
v = np.array([[0,0,0],[1,0,0],[0,1,0]], dtype=np.float32)
t = np.array([[0,1,2]], dtype=np.uint64)

def make_triangle(path):
    nx.CreateDataArrayFilter.execute(ds, numeric_type_index=nx.NumericType.float32,
        component_count=3, tuple_dimensions=[[3]], output_array_path=nx.DataPath("V"),
        initialization_value_str='0')
    ds[nx.DataPath("V")].npview()[:] = v
    nx.CreateDataArrayFilter.execute(ds, numeric_type_index=nx.NumericType.uint64,
        component_count=3, tuple_dimensions=[[1]], output_array_path=nx.DataPath("T"),
        initialization_value_str='0')
    ds[nx.DataPath("T")].npview()[:] = t
    nx.CreateGeometryFilter.execute(ds, array_handling_index=1, geometry_type_index=4,
        output_geometry_path=nx.DataPath(path),
        face_attribute_matrix_name="Face Data", edge_attribute_matrix_name="Edge Data",
        vertex_attribute_matrix_name="Vertex Data",
        vertex_list_path=nx.DataPath("V"), triangle_list_path=nx.DataPath("T"))

make_triangle("TopTri")                                   # top-level geometry
nx.CreateDataGroupFilter.execute(ds, data_object_path=nx.DataPath("Grp"))
make_triangle("Grp/NestTri")                              # geometry inside a DataGroup

nx.WriteDREAM3DFilter.execute(ds, export_file_path="/tmp/cmp.dream3d", write_xdmf_file=False)
# ^ writes with no errors

# Read it back:
ds2 = nx.DataStructure()
imp = nx.Dream3dImportParameter.ImportData(file_path="/tmp/cmp.dream3d")
nx.ReadDREAM3DFilter.execute(data_structure=ds2, import_data_object=imp)   # CRASH

Expected

The geometry nested under Grp/ reads back identically to the top-level one.

Actual

The read aborts:

Could not open Group 'Grp/NestTri'. Child object does not exist or object is not a Group
HDF5-DIAG: Error detected in HDF5 (1.14.6) thread 1:
  #000: H5G.c line 437 in H5Gopen2(): unable to synchronously open group
  #001: H5G.c line 391 in H5G__open_api_common(): name parameter cannot be an empty string
    major: Invalid arguments to routine
    minor: Bad value
RuntimeError: nx::core::HDF5::GetNameFromBuffer : HDF5 data path cannot be empty.

Notes / investigation

  • The on-disk HDF5 for the nested geometry looks structurally valid: the TriangleGeom
    group has the expected Vertex List ID, Face List ID, Vertex Data ID, Face Data ID
    attributes and references its children by ObjectId (not by path).
  • An identical geometry written at the top level reads fine, so the trigger is specifically
    that the geometry is a child of a DataGroup.
  • The empty-name H5Gopen2 / GetNameFromBuffer errors suggest the reader builds an empty
    HDF5 path component when reconstructing a geometry that is not a direct child of the root.

Workaround

Write geometries at the top level (e.g. with a flat name prefix instead of a parent group).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions