step-examples/12-11-adversarial/Ad100.stp
Sources
- OCCT MANTIS#0031075
- OCCT MANTIS#0022807
- OCCT MANTIS#0022941 (OCCT MANTIS tracker 502 as of 2026-05-02)
Description
A STEP read into an XCAF document leaks ~MB of memory per file. Cause: the entity-graph table holds strong references to entities that are no longer referenced by any final shape, but document destruction doesn't walk the graph.
Reproducer recipe
Read 100 STEP files in succession into a single process; observe memory growth proportional to the number of files even when each document is destroyed.
Expected kernel behavior
Heal and accept: document destruction releases all internal caches; no shared globals retain entity references between reads. Must not leak memory.
Notes
**See also**: A076. Provenance tier: cross-file-state; bytes alone cannot demonstrate this defect; the symptom is monotonic process-RSS growth across many successive reads of any STEP file. Demonstrating this requires the kernel to retain state across documents and an external memory measurement, not a single fixture.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(1) ifc=schema_n/a
Provenance tier
cross-file-state — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'ISO-10303-21')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/* Ad100: STEP read into XCAF TDocStd_Document leaks entity-graph table; strong references to entities unreachable from final shape retained; document destruction does not walk entity graph; RSS grows proportionally to number of files read; document destruction must release all internal caches; OCCT MANTIS#0031075, #0022807, #0022941; See also A076; cross-file-state defect; fixture is a companion STEP file; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Ad100'),'2;1'); 5FILE_NAME('Ad100.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 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('Ad100','Ad100','',(#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=CARTESIAN_POINT('orphan_pt_00',(0.0,0.0,0.0)); 26#9064=DIRECTION('orphan_dir_00',(1.0,0.0,0.0)); 27#9065=VERTEX_POINT('orphan_vt_00',#9063); 28#9066=CARTESIAN_POINT('orphan_pt_01',(1.0,0.0,0.0)); 29#9067=DIRECTION('orphan_dir_01',(1.0,0.0,0.0)); 30#9068=VERTEX_POINT('orphan_vt_01',#9066); 31#9069=CARTESIAN_POINT('orphan_pt_02',(2.0,0.0,0.0)); 32#9070=DIRECTION('orphan_dir_02',(1.0,0.0,0.0)); 33#9071=VERTEX_POINT('orphan_vt_02',#9069); 34#9072=CARTESIAN_POINT('orphan_pt_03',(3.0,0.0,0.0)); 35#9073=DIRECTION('orphan_dir_03',(1.0,0.0,0.0)); 36#9074=VERTEX_POINT('orphan_vt_03',#9072); 37#9075=CARTESIAN_POINT('orphan_pt_04',(4.0,0.0,0.0)); 38#9076=DIRECTION('orphan_dir_04',(1.0,0.0,0.0)); 39#9077=VERTEX_POINT('orphan_vt_04',#9075); 40#9078=CARTESIAN_POINT('orphan_pt_05',(5.0,0.0,0.0)); 41#9079=DIRECTION('orphan_dir_05',(1.0,0.0,0.0)); 42#9080=VERTEX_POINT('orphan_vt_05',#9078); 43#9081=CARTESIAN_POINT('orphan_pt_06',(6.0,0.0,0.0)); 44#9082=DIRECTION('orphan_dir_06',(1.0,0.0,0.0)); 45#9083=VERTEX_POINT('orphan_vt_06',#9081); 46#9084=CARTESIAN_POINT('orphan_pt_07',(7.0,0.0,0.0)); 47#9085=DIRECTION('orphan_dir_07',(1.0,0.0,0.0)); 48#9086=VERTEX_POINT('orphan_vt_07',#9084); 49#9087=CARTESIAN_POINT('orphan_pt_08',(8.0,0.0,0.0)); 50#9088=DIRECTION('orphan_dir_08',(1.0,0.0,0.0)); 51#9089=VERTEX_POINT('orphan_vt_08',#9087); 52#9090=CARTESIAN_POINT('orphan_pt_09',(9.0,0.0,0.0)); 53#9091=DIRECTION('orphan_dir_09',(1.0,0.0,0.0)); 54#9092=VERTEX_POINT('orphan_vt_09',#9090); 55#9093=/* memory-leak trigger: read this file 100 times in succession; 56 measure RSS before and after each read; 57 leak is visible as monotonic growth proportional to file count; 58 each document destruction should release entity-graph entries */ 59CARTESIAN_POINT('leak_probe',(99.0,0.0,0.0)); 60ENDSEC; 61END-ISO-10303-21;