Twi230 — Two LINEs write an unparseable `#TYPE(...)` token in the vector slot, so the reader aborts before high-knot-count intersection analysis is reached

§12.3b

crash topology

Sources

Description

Two LINEs write an unparseable `#TYPE(...)` token in the vector slot, so the reader aborts before high-knot-count intersection analysis is reached

Reproducer recipe

Expected kernel behavior

Reject with a diagnostic naming entity #401: its LINE's vector argument is the unparseable token `#DIRECTION('',(0.0,1.0,0.0))` rather than a `#N` reference, so Part 21 parsing itself must fail on this entity — a kernel should report the malformed token and its position rather than crash. LINE #405 repeats the same error and the B_SPLINE_CURVE_WITH_KNOTS at #403 nests it again in a pole list; all three must be reported once parsing is made robust enough to continue past the first one. The high-knot-count intersection question the old title posed about the 11-pole B-spline at #220, whose knot values run from 0.0 to 10.0 in steps of 0.5, is unreachable until then.

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/* Twi230 - ShapeAnalysis_Wire.CheckIntersectingEdges B-spline-edge-with-many-knots
3 * Defect: Wire with high-knot-count B-spline edges. CheckIntersectingEdges's
4 * sub-segment comparison overflows internal buffer or produces quadratic
5 * explosion in intersection tests.
6 */
7HEADER;
8FILE_DESCRIPTION(('Twi230 test case','CheckIntersectingEdges B-spline-edge-with-many-knots — buffer overflow'),'2;1');
9FILE_NAME('Twi230.stp','2026-06-15T00:00:00',('[email protected]'),(''),'cad-research-suite','','');
10FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
11ENDSEC;
12DATA;
13#1=APPLICATION_CONTEXT('automotive_design');
14#2=APPLICATION_PROTOCOL_DEFINITION('international standard','automotive_design',2000,#1);
15#100=CARTESIAN_POINT('',(0.0,0.0,0.0));
16#101=DIRECTION('',(0.0,0.0,1.0));
17#102=DIRECTION('',(1.0,0.0,0.0));
18#103=AXIS2_PLACEMENT_3D('',#100,#101,#102);
19#104=PLANE('',#103);
20/* B-spline curve with many knots for high-complexity edge */
21#200=CARTESIAN_POINT('',(0.0,0.0,0.0));
22#201=CARTESIAN_POINT('',(1.0,0.5,0.0));
23#202=CARTESIAN_POINT('',(2.0,0.2,0.0));
24#203=CARTESIAN_POINT('',(3.0,0.8,0.0));
25#204=CARTESIAN_POINT('',(4.0,0.1,0.0));
26#205=CARTESIAN_POINT('',(5.0,0.9,0.0));
27#206=CARTESIAN_POINT('',(6.0,0.3,0.0));
28#207=CARTESIAN_POINT('',(7.0,0.7,0.0));
29#208=CARTESIAN_POINT('',(8.0,0.4,0.0));
30#209=CARTESIAN_POINT('',(9.0,0.6,0.0));
31#210=CARTESIAN_POINT('',(10.0,0.0,0.0));
32/* Complex B-spline with high knot multiplicity */
33#220=B_SPLINE_CURVE_WITH_KNOTS('bspl1',3,
34  (#200,#201,#202,#203,#204,#205,#206,#207,#208,#209,#210),
35  (0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0),
36  (3,2,2,2,2,2,2,2,2,2,3),.U.);
37/* Vertices for wire */
38#300=CARTESIAN_POINT('',(0.0,0.0,0.0));
39#301=CARTESIAN_POINT('',(10.0,0.0,0.0));
40#302=CARTESIAN_POINT('',(10.0,5.0,0.0));
41#303=CARTESIAN_POINT('',(0.0,5.0,0.0));
42#310=VERTEX_POINT('',#300);
43#311=VERTEX_POINT('',#301);
44#312=VERTEX_POINT('',#302);
45#313=VERTEX_POINT('',#303);
46/* Edge1: complex B-spline with many knots */
47#400=EDGE_CURVE('',#310,#311,#220,.T.);
48/* Edge2: straight edge */
49#401=LINE('',#301,#DIRECTION('',(0.0,1.0,0.0)));
50#402=EDGE_CURVE('',#311,#312,#401,.T.);
51/* Edge3: another complex curve with many control points */
52#403=B_SPLINE_CURVE_WITH_KNOTS('bspl2',2,
53  (#CARTESIAN_POINT('',(10.0,5.0,0.0)),#CARTESIAN_POINT('',(9.0,4.8,0.0)),#CARTESIAN_POINT('',(8.0,4.9,0.0)),
54   #CARTESIAN_POINT('',(7.0,5.1,0.0)),#CARTESIAN_POINT('',(6.0,4.95,0.0)),#CARTESIAN_POINT('',(5.0,5.05,0.0)),
55   #CARTESIAN_POINT('',(4.0,4.9,0.0)),#CARTESIAN_POINT('',(3.0,5.1,0.0)),#CARTESIAN_POINT('',(2.0,4.95,0.0)),
56   #CARTESIAN_POINT('',(1.0,5.05,0.0)),#CARTESIAN_POINT('',(0.0,5.0,0.0))),
57  (0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0),
58  (2,2,2,2,2,2,2,2,2,2,2),.U.);
59#404=EDGE_CURVE('',#312,#313,#403,.T.);
60/* Edge4: closing straight edge */
61#405=LINE('',#303,#DIRECTION('',(0.0,-1.0,0.0)));
62#406=EDGE_CURVE('',#313,#310,#405,.T.);
63/* Oriented edges */
64#500=ORIENTED_EDGE('',*,*,#400,.T.);
65#501=ORIENTED_EDGE('',*,*,#402,.T.);
66#502=ORIENTED_EDGE('',*,*,#404,.T.);
67#503=ORIENTED_EDGE('',*,*,#406,.T.);
68/* Closed edge loop */
69#510=EDGE_LOOP('',(#500,#501,#502,#503));
70/* Face */
71#520=FACE_OUTER_BOUND('',#510,.T.);
72#521=ADVANCED_FACE('',(#520),#104,.T.);
73/* Shell and manifold representation */
74#600=CLOSED_SHELL('',(#521));
75#9021=SHELL_BASED_SURFACE_MODEL('sbsm',(#600));
76#9000=PRODUCT_CONTEXT('',#1,'mechanical');
77#9001=PRODUCT('Twi230','Twi230','',(#9000));
78#9002=PRODUCT_DEFINITION_FORMATION('','',#9001);
79#9003=PRODUCT_DEFINITION_CONTEXT('part definition',#1,'design');
80#9004=PRODUCT_DEFINITION('','',#9002,#9003);
81#9005=PRODUCT_DEFINITION_SHAPE('','',#9004);
82#9006=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
83#9007=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
84#9008=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
85#9009=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9006,'distance_accuracy_value','');
86#9010=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9009))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9006,#9007,#9008))REPRESENTATION_CONTEXT('','3D'));
87#9022=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#9021),#9010);
88#9023=SHAPE_DEFINITION_REPRESENTATION(#9005,#9022);
89ENDSEC;
90END-ISO-10303-21;