step-examples/12-6-assembly/P028.stp
Sources
- FreeCAD #18056, #18096, #14567, #17677
Sender
FreeCAD itself
Description
An assembly-document carries non-shape labels (Joints, Variables, Constraints, Configurations, LinkGroup); labels whose attached topological shape is null. The STEP writer's color-attribution pass dereferences the null shape during traversal and crashes; the resulting STEP file is truncated mid-write.
Reproducer recipe
Truncated STEP file (writer crash before END marker) — also see P069 for general truncation.
Expected kernel behavior
skip non-shape labels with a warning, or filter them out before traversal. A null subshape encountered during writer traversal must not crash the writer.
Notes
Validation observed: silent-empty rather than crash. Kernel-mishandling-by-silent-acceptance still demonstrates the defect class. Synonyms: "empty/null shape entries in OCAF document", "OCAF doc with NULL shape labels corrupts STEP write", "writer chokes on empty TDF labels".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(1) ifc=schema_n/a
Byte assertions
contains(b'NEXT_ASSEMBLY_USAGE_OCCURRENCE')contains(b'Empty/null shape entries') or contains(b'P028') or contains(b'truncated')
Tier-3 assertions
shape_null == Falsen_vertices_total == 1
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* P028: Assembly OCAF document contains non-shape labels with null topological shape: Joints, Variables, Constraints, Configurations, LinkGroup labels all have null shapes; STEP writer color-attribution pass dereferences null shape during traversal and crashes; resulting STEP file is truncated mid-write (truncated output); Empty/null shape entries in PRODUCT_DEFINITION chain; kernel must skip non-shape labels with a warning before traversal; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('P028'),'2;1'); 5FILE_NAME('P028.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF { 1 0 10303 442 1 1 4 }')); 7ENDSEC; 8DATA; 9#9000=APPLICATION_CONTEXT('mechanical design'); 10#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 11#2=GEOMETRIC_CURVE_SET('',(#1)); 12#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 13#9051=PRODUCT('P028','P028','',(#9050)); 14#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 15#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 16#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 17#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 18#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 19#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 20#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 21#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 22#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 23#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#2),#9060); 24#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 25#9063=PRODUCT_CONTEXT('sub',#9000,'mechanical'); 26#9064=PRODUCT('OcafAssembly','OcafAssembly','OCAF doc assembly root',(#9063)); 27#9065=PRODUCT_DEFINITION_FORMATION('','',#9064); 28#9066=PRODUCT_DEFINITION('design','',#9065,#9053); 29#9067=PRODUCT('Joints','Joints','null-shape OCAF label: Joints',(#9063)); 30#9068=PRODUCT_DEFINITION_FORMATION('','',#9067); 31#9069=PRODUCT_DEFINITION('design','',#9068,#9053); 32#9070=NEXT_ASSEMBLY_USAGE_OCCURRENCE('1','Joints_null_label','',#9066,#9069,$); 33#9071=PRODUCT('Variables','Variables','null-shape OCAF label: Variables',(#9063)); 34#9072=PRODUCT_DEFINITION_FORMATION('','',#9071); 35#9073=PRODUCT_DEFINITION('design','',#9072,#9053); 36#9074=NEXT_ASSEMBLY_USAGE_OCCURRENCE('2','Variables_null_label','',#9066,#9073,$); 37#9075=PRODUCT('Constraints','Constraints','null-shape OCAF label: Constraints',(#9063)); 38#9076=PRODUCT_DEFINITION_FORMATION('','',#9075); 39#9077=PRODUCT_DEFINITION('design','',#9076,#9053); 40#9078=NEXT_ASSEMBLY_USAGE_OCCURRENCE('3','Constraints_null_label','',#9066,#9077,$); 41#9079=PRODUCT('Configurations','Configurations','null-shape OCAF label: Configurations',(#9063)); 42#9080=PRODUCT_DEFINITION_FORMATION('','',#9079); 43#9081=PRODUCT_DEFINITION('design','',#9080,#9053); 44#9082=NEXT_ASSEMBLY_USAGE_OCCURRENCE('4','Configurations_null_label','',#9066,#9081,$); 45ENDSEC; 46END-ISO-10303-21;