Environment
- ngsolve / netgen 6.2.2604 (pip)
- macOS (Darwin, arm64), Python 3.14
Summary
A 2D OCC mesh refined with mesh.RefineHP(...) saves to .vol without error, but loading that file crashes with a fatal signal — no Python exception. The signal is non-deterministic across runs (observed both SIGSEGV/11 and SIGBUS/10 for the identical script), indicating memory corruption in the .vol reader rather than a handled error. Removing the RefineHP line makes save/load work. This is the documented OCC hp pattern (edge.hpref + mesh.RefineHP(levels, factor)), so it is not a misuse.
Minimal reproducer
import os, tempfile
import ngsolve
from netgen.occ import OCCGeometry, WorkPlane
from netgen.meshing import Mesh as NgMesh
face = WorkPlane().Rectangle(1, 1).Face()
face.edges[0].hpref = 1
mesh = ngsolve.Mesh(OCCGeometry(face, dim=2).GenerateMesh(maxh=0.3))
mesh.RefineHP(levels=2, factor=0.2) # remove this line -> save/load works
vol = os.path.join(tempfile.mkdtemp(), "m.vol")
mesh.ngmesh.Save(vol) # OK
print("Save OK, loading...")
NgMesh().Load(vol) # <-- fatal signal (SIGSEGV / SIGBUS)
print("Load OK") # never reached
Observed (two runs of the identical script)
Save OK, loading...
zsh: segmentation fault python repro.py
Save OK, loading...
zsh: bus error python repro.py
Independent of maxh / mesh resolution.
Expected
Load reproduces the saved mesh, or raises a clean Python exception — not a process crash.
Environment
Summary
A 2D OCC mesh refined with
mesh.RefineHP(...)saves to.volwithout error, but loading that file crashes with a fatal signal — no Python exception. The signal is non-deterministic across runs (observed both SIGSEGV/11 and SIGBUS/10 for the identical script), indicating memory corruption in the.volreader rather than a handled error. Removing theRefineHPline makes save/load work. This is the documented OCC hp pattern (edge.hpref+mesh.RefineHP(levels, factor)), so it is not a misuse.Minimal reproducer
Observed (two runs of the identical script)
Independent of maxh / mesh resolution.
Expected
Loadreproduces the saved mesh, or raises a clean Python exception — not a process crash.