Tsh125 — ShapeFix_Shell.Perform recursive context

§12.3a

crash topology

Sources

Description

ShapeFix_Shell.Perform recursive context

Reproducer recipe

Expected kernel behavior

Live oracle measurement: OCCT crashes (SIGSEGV) reading this file, on both the heal-on and heal-off path. Two of the four box faces (bottom and the x=10 side) are authored with inverted normals (same_sense=.T. but their PLANE reference direction and loop winding compose to point inward) while the other two are correct; all four share edges with their neighbours. A kernel must never crash on this input, and any orientation-fix logic that flips a face while visiting its neighbours must use per-call state only — an already-corrected face must never be revisited and flipped again while fixing a later, unrelated face in the same shell.

Expected validation

occt=signal(11)/signal(11) gmsh=signal(11) ifc=schema_n/a

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ISO-10303-21;
2/* Tsh125 - ShapeFix_Shell.Perform recursive context
3 * Defect: Perform calls FixFaceOrientation which calls Perform recursively;
4 * recursion termination uses depth counter but doesn't reset for sibling-face processing */
5HEADER;
6FILE_DESCRIPTION(('Tsh125 - shell with faces triggering recursive Perform without depth reset','wave 26'),'2;1');
7FILE_NAME('Tsh125.stp','2026-06-15T00:00:00',(''),(''),'heal coverage','','');
8FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
9ENDSEC;
10DATA;
11#1=APPLICATION_CONTEXT('automotive_design');
12#2=APPLICATION_PROTOCOL_DEFINITION('international standard','automotive_design',2000,#1);
13
14/* Shell with multiple faces that need orientation fixing */
15/* Face 1: bottom rectangle (0,0,0)-(10,0,0)-(10,10,0)-(0,10,0) normal = (0,0,-1) INVERTED */
16/* Face 2: right rectangle (10,0,0)-(10,10,0)-(10,10,10)-(10,0,10) normal = (1,0,0) INVERTED */
17/* Face 3: front rectangle (0,0,0)-(10,0,0)-(10,0,10)-(0,0,10) normal = (0,-1,0) CORRECT */
18/* Face 4: back rectangle (0,10,0)-(0,10,10)-(10,10,10)-(10,10,0) normal = (0,1,0) CORRECT */
19
20#10=CARTESIAN_POINT('',(0,0,0));
21#11=CARTESIAN_POINT('',(10.0,0,0));
22#12=CARTESIAN_POINT('',(10.0,10.0,0));
23#13=CARTESIAN_POINT('',(0,10.0,0));
24#14=CARTESIAN_POINT('',(10.0,0,10.0));
25#15=CARTESIAN_POINT('',(10.0,10.0,10.0));
26#16=CARTESIAN_POINT('',(0,10.0,10.0));
27#17=CARTESIAN_POINT('',(0,0,10.0));
28
29#20=VERTEX_POINT('',#10);
30#21=VERTEX_POINT('',#11);
31#22=VERTEX_POINT('',#12);
32#23=VERTEX_POINT('',#13);
33#24=VERTEX_POINT('',#14);
34#25=VERTEX_POINT('',#15);
35#26=VERTEX_POINT('',#16);
36#27=VERTEX_POINT('',#17);
37
38/* Planes */
39#30=AXIS2_PLACEMENT_3D('z0_plane',#10,DIRECTION('',(0,0,-1)),DIRECTION('',(1,0,0)));
40#31=PLANE('',#30);
41#32=AXIS2_PLACEMENT_3D('x10_plane',#11,DIRECTION('',(1,0,0)),DIRECTION('',(0,0,1)));
42#33=PLANE('',#32);
43#34=AXIS2_PLACEMENT_3D('y0_plane',#10,DIRECTION('',(0,-1,0)),DIRECTION('',(1,0,0)));
44#35=PLANE('',#34);
45#36=AXIS2_PLACEMENT_3D('y10_plane',#13,DIRECTION('',(0,1,0)),DIRECTION('',(1,0,0)));
46#37=PLANE('',#36);
47
48/* Face 1 edges (bottom, inverted normal) */
49#50=LINE('',#10,VECTOR('',(1,0,0),10.0));
50#51=EDGE_CURVE('f1_e1',#20,#21,#50,.T.);
51#52=LINE('',#11,VECTOR('',(0,1,0),10.0));
52#53=EDGE_CURVE('f1_e2',#21,#22,#52,.T.);
53#54=LINE('',#12,VECTOR('',(-1,0,0),10.0));
54#55=EDGE_CURVE('f1_e3',#22,#23,#54,.T.);
55#56=LINE('',#13,VECTOR('',(0,-1,0),10.0));
56#57=EDGE_CURVE('f1_e4',#23,#20,#56,.T.);
57
58/* Face 2 edges (right, inverted normal) */
59#60=LINE('',#11,VECTOR('',(0,1,0),10.0));
60#61=EDGE_CURVE('f2_e1',#21,#22,#60,.T.);
61#62=LINE('',#12,VECTOR('',(0,0,1),10.0));
62#63=EDGE_CURVE('f2_e2',#22,#25,#62,.T.);
63#64=LINE('',#15,VECTOR('',(0,-1,0),10.0));
64#65=EDGE_CURVE('f2_e3',#25,#24,#64,.T.);
65#66=LINE('',#14,VECTOR('',(0,0,-1),10.0));
66#67=EDGE_CURVE('f2_e4',#24,#21,#66,.T.);
67
68/* Face 3 edges (front) */
69#70=LINE('',#10,VECTOR('',(1,0,0),10.0));
70#71=EDGE_CURVE('f3_e1',#20,#21,#70,.T.);
71#72=LINE('',#11,VECTOR('',(0,0,1),10.0));
72#73=EDGE_CURVE('f3_e2',#21,#24,#72,.T.);
73#74=LINE('',#14,VECTOR('',(-1,0,0),10.0));
74#75=EDGE_CURVE('f3_e3',#24,#27,#74,.T.);
75#76=LINE('',#17,VECTOR('',(0,0,-1),10.0));
76#77=EDGE_CURVE('f3_e4',#27,#20,#76,.T.);
77
78/* Face 4 edges (back) */
79#80=LINE('',#13,VECTOR('',(0,0,1),10.0));
80#81=EDGE_CURVE('f4_e1',#23,#26,#80,.T.);
81#82=LINE('',#16,VECTOR('',(1,0,0),10.0));
82#83=EDGE_CURVE('f4_e2',#26,#25,#82,.T.);
83#84=LINE('',#15,VECTOR('',(0,0,-1),10.0));
84#85=EDGE_CURVE('f4_e3',#25,#22,#84,.T.);
85#86=LINE('',#12,VECTOR('',(-1,0,0),10.0));
86#87=EDGE_CURVE('f4_e4',#22,#23,#86,.T.);
87
88/* Face 1 edge loop (inverted, counterclockwise when viewed from below) */
89#100=ORIENTED_EDGE('',*,*,#51,.T.);
90#101=ORIENTED_EDGE('',*,*,#53,.T.);
91#102=ORIENTED_EDGE('',*,*,#55,.T.);
92#103=ORIENTED_EDGE('',*,*,#57,.T.);
93#104=EDGE_LOOP('f1_loop',(#100,#101,#102,#103));
94
95/* Face 2 edge loop (inverted, wrong orientation) */
96#110=ORIENTED_EDGE('',*,*,#61,.F.);
97#111=ORIENTED_EDGE('',*,*,#63,.T.);
98#112=ORIENTED_EDGE('',*,*,#65,.F.);
99#113=ORIENTED_EDGE('',*,*,#67,.T.);
100#114=EDGE_LOOP('f2_loop',(#110,#111,#112,#113));
101
102/* Face 3 edge loop */
103#120=ORIENTED_EDGE('',*,*,#71,.T.);
104#121=ORIENTED_EDGE('',*,*,#73,.T.);
105#122=ORIENTED_EDGE('',*,*,#75,.T.);
106#123=ORIENTED_EDGE('',*,*,#77,.T.);
107#124=EDGE_LOOP('f3_loop',(#120,#121,#122,#123));
108
109/* Face 4 edge loop */
110#130=ORIENTED_EDGE('',*,*,#81,.T.);
111#131=ORIENTED_EDGE('',*,*,#83,.T.);
112#132=ORIENTED_EDGE('',*,*,#85,.T.);
113#133=ORIENTED_EDGE('',*,*,#87,.T.);
114#134=EDGE_LOOP('f4_loop',(#130,#131,#132,#133));
115
116/* Face bounds */
117#150=FACE_OUTER_BOUND('',#104,.T.);
118#151=FACE_OUTER_BOUND('',#114,.T.);
119#152=FACE_OUTER_BOUND('',#124,.T.);
120#153=FACE_OUTER_BOUND('',#134,.T.);
121
122/* Faces */
123#160=ADVANCED_FACE('f1_inverted',(#150),#31,.T.);
124#161=ADVANCED_FACE('f2_inverted',(#151),#33,.T.);
125#162=ADVANCED_FACE('f3',(#152),#35,.T.);
126#163=ADVANCED_FACE('f4',(#153),#37,.T.);
127
128/* Shell with multiple faces requiring orientation fixing */
129#200=OPEN_SHELL('recursive_context_shell',(#160,#161,#162,#163));
130
131/* Mandatory PRODUCT chain */
132#9000=PRODUCT_CONTEXT('',#1,'mechanical');
133#9001=PRODUCT('Tsh125','Tsh125','',(#9000));
134#9002=PRODUCT_DEFINITION_FORMATION('','',#9001);
135#9003=PRODUCT_DEFINITION_CONTEXT('part definition',#1,'design');
136#9004=PRODUCT_DEFINITION('','',#9002,#9003);
137#9005=PRODUCT_DEFINITION_SHAPE('','',#9004);
138#9006=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
139#9007=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
140#9008=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
141#9009=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9006,'distance_accuracy_value','');
142#9010=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9009))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9006,#9007,#9008))REPRESENTATION_CONTEXT('','3D'));
143#9021=SHELL_BASED_SURFACE_MODEL('sbsm',(#200));
144#9022=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#9021),#9010);
145#9023=SHAPE_DEFINITION_REPRESENTATION(#9005,#9022);
146ENDSEC;
147END-ISO-10303-21;