step-examples/12-11-adversarial/Ad046.stp
Sources
- 03-occt-tests.md R050 (empty `APPLIED_GROUP_ASSIGNMENT` write exception), R067 (writer exception)
- 19-datasets.md D025 (FreeCAD #5783 STEP-export crash via missing pcurve)
- 18-other-issues.md I050 (SolveSpace 0-byte STEP/PDF)
Description
Writer-side null-deref when a shape has missing handles or empty group attributes. Common trigger: an `EDGE_CURVE` used on an `ADVANCED_FACE` whose curve is a bare 3D `LINE` (no `SURFACE_CURVE` wrapper, no pcurve), combined with an `APPLIED_GROUP_ASSIGNMENT` whose `items` list is empty; both attributes the writer dereferences without a null check. Producer crashes producing zero-byte output.
Reproducer recipe
shape with missing 2D-parametric curve fed to STEP writer; or SolveSpace lathe-then-extrusion-difference part.
Expected kernel behavior
detect missing handle, fall back to recompute, or skip with warning; never crash.
Notes
**See also**: Ad043. Validation observed: silent-empty rather than the cited crash. The structural attack pattern (e.g., billion-laughs / cyclic-reference / very-large-string) is demonstrated; production-scale exploitation requires inflating the size factor as described. Kernel-mishandling-by-silent-acceptance is itself a defect signal at fixture scale. Provenance tier: runtime-only; bytes alone cannot demonstrate the writer-side crash; the catalogued defect is a writer null-deref, but the fixture is a reader-input file. The crash manifests only when a kernel attempts to re-write a previously-loaded shape that retains the missing-handle precondition in multi-pass kernel state. A behavioral test against the writer is the appropriate venue. **OCC behavior**: silently accepts (no diagnostic, empty result); outside catalog's allowed set ({warn-and-proceed}). Kernel-bug witnessed: catalog wants a warning to surface; OCC accepts without any diagnostic.
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
runtime-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'APPLIED_GROUP_ASSIGNMENT')contains(b'END-ISO-10303-21')
Tier-3 assertions
load == "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Ad046: writer null-deref: EDGE_CURVE on ADVANCED_FACE with bare 3D LINE and no SURFACE_CURVE/pcurve; APPLIED_GROUP_ASSIGNMENT with empty items list; both trigger null-deref in writer output path; FreeCAD #5783 / SolveSpace 0-byte STEP output; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Ad046'),'2;1'); 5FILE_NAME('Ad046.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=CARTESIAN_POINT('',(0.0,0.0,0.0)); 12#4=CARTESIAN_POINT('',(1.0,0.0,0.0)); 13#5=CARTESIAN_POINT('',(0.0,0.0,1.0)); 14#6=DIRECTION('',(0.0,0.0,1.0)); 15#7=DIRECTION('',(1.0,0.0,0.0)); 16#8=AXIS2_PLACEMENT_3D('',#3,#6,#7); 17#9=PLANE('',#8); 18#10=CARTESIAN_POINT('',(0.0,0.0,0.0)); 19#11=CARTESIAN_POINT('',(1.0,0.0,0.0)); 20#12=CARTESIAN_POINT('',(1.0,1.0,0.0)); 21#13=CARTESIAN_POINT('',(0.0,1.0,0.0)); 22#14=DIRECTION('',(1.0,0.0,0.0)); 23#15=DIRECTION('',(0.0,1.0,0.0)); 24#16=DIRECTION('',(-1.0,0.0,0.0)); 25#17=DIRECTION('',(0.0,-1.0,0.0)); 26#18=VECTOR('',#14,1.0); 27#19=VECTOR('',#15,1.0); 28#20=VECTOR('',#16,1.0); 29#21=VECTOR('',#17,1.0); 30#22=LINE('',#10,#18); 31#23=LINE('',#11,#19); 32#24=LINE('',#12,#20); 33#25=LINE('',#13,#21); 34#26=VERTEX_POINT('',#10); 35#27=VERTEX_POINT('',#11); 36#28=VERTEX_POINT('',#12); 37#29=VERTEX_POINT('',#13); 38#30=EDGE_CURVE('',#26,#27,#22,.T.); 39#31=EDGE_CURVE('',#27,#28,#23,.T.); 40#32=EDGE_CURVE('',#28,#29,#24,.T.); 41#33=EDGE_CURVE('',#29,#26,#25,.T.); 42#34=ORIENTED_EDGE('',$,$,#30,.T.); 43#35=ORIENTED_EDGE('',$,$,#31,.T.); 44#36=ORIENTED_EDGE('',$,$,#32,.T.); 45#37=ORIENTED_EDGE('',$,$,#33,.T.); 46#38=EDGE_LOOP('',(#34,#35,#36,#37)); 47#39=FACE_OUTER_BOUND('',#38,.T.); 48#40=ADVANCED_FACE('',(#39),#9,.T.); 49#41=GROUP('empty_group','triggers writer null-deref on empty items'); 50#42=APPLIED_GROUP_ASSIGNMENT(#41,(#40),()); 51ENDSEC; 52END-ISO-10303-21;