step-examples/12-11-adversarial/Ad043.stp
Sources
- 03-occt-tests.md R043 (`bug22871`, `bug16351`, `bug23157`, `bug24383`, `bug25912`, `bug133_2/3/9`)
- R057 (material missing name `bug23251`)
- R045 (empty `EDGE_LOOP` `bug33307`)
- R067 (writer exception `bug24990`)
- 04-occt-translation.md Q078
- 08-occt-gitlog.md G027 (`STYLED_ITEM.item` NULL), G029 (NULL vertex name/id), G034, G035, G050, G063, G083, G085, G086, G109 (GD&T null-deref family)
- 18-other-issues.md I001, I003, I004, I044
Description
Reader paths assume non-null entity references and throw an uncaught exception (access violation, out-of-range, or similar) when a STEP file references a non-existent entity, supplies a null `swept_curve`, has an empty edge loop, a `STYLED_ITEM` with a null `item` reference, a vertex with null name/id, etc. The exception escapes across the reader's API boundary and aborts the import.
Reproducer recipe
any of the above patterns; e.g. `STYLED_ITEM('',(..),#null);` where `#null` is unresolved.
Expected kernel behavior
Every reader path must be defensive against null and dangling references; warn-and-accept (skip the offending instance with diagnostic), return an empty/partial result, or reject and signal failure via a status flag. Never let an unhandled exception escape across the parser/importer ABI; must not crash.
Notes
Cross-oracle: pure-Python Part-21 validator rejects (reject(E_UNRESOLVED_REFS)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'#999')contains(b'STYLED_ITEM') and contains(b'#999')
Tier-3 assertions
load == "ok"
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Ad043: null / dangling entity reference: STYLED_ITEM.item = #999 (never declared); STYLED_ITEM references swept_curve = #998 (never declared); reader throws uncaught exception across ABI on unresolved ref; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Ad043'),'2;1'); 5FILE_NAME('Ad043.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 10#2=GEOMETRIC_CURVE_SET('',(#1)); 11#3=STYLED_ITEM('',(#1),#999); 12#4=SURFACE_STYLE_USAGE(.BOTH.,#999); 13#5=EXTRUDED_AREA_SOLID('',#999,#1,10.0); 14#6=VERTEX_POINT('',#999); 15ENDSEC; 16END-ISO-10303-21;