step-examples/12-13-writer-pathology/Wr029.stp
Sources
- OCCT forum "header description has line break"
- bug-reporter language: "string in STEP wraps mid-line"
Sender
Writers that paste user-entered description text into `FILE_DESCRIPTION` without escaping line breaks
Description
A `FILE_DESCRIPTION(('line one\nline two'),'2;1')` where the literal `\n` is an embedded newline (not the two-character escape, the actual 0x0A byte) terminates the string for crude line-based parsers. Spec violation per ISO 10303-21 §6.4 (control characters in string literals). Bug-reporter language: "STEP file string has line break", "FILE_DESCRIPTION corrupt".
Reproducer recipe
literal `FILE_DESCRIPTION(('first line` (newline) `second line'),'2;1')`.
Expected kernel behavior
reject as malformed per spec; do not silently splice the broken string back together because the splice point is undefined.
Notes
Le017 covers from read side; Wr029 attributes to writer. **OCC behavior**: silently accepts the broken-string file (no diagnostic, empty result); kernel mishandling; not what kernels should do. Provenance tier: writer-side (Q5 full-corpus 2026-07-01).
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
writer-side — defect not fully embodied in fixture bytes.
Byte assertions
matches(rb"FILE_DESCRIPTION\(\('[^']*\n[^']*'")matches(rb"FILE_DESCRIPTION\(\(\s*'[^']*\n")
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/* Wr029: FILE_DESCRIPTION with embedded literal newline (0x0A) in string */ 3/* Writers that paste user text into FILE_DESCRIPTION without escaping LF */ 4/* Crude line-based parsers terminate the string at the embedded newline */ 5/* Spec violation: ISO 10303-21 §6.4 forbids control characters in strings */ 6HEADER; 7/* DEFECT: the FILE_DESCRIPTION string contains a real 0x0A byte mid-string */ 8FILE_DESCRIPTION(('first line 9second line'),'2;1'); 10FILE_NAME('Wr029.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 11FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 12ENDSEC; 13DATA; 14#1=CARTESIAN_POINT('origin',(0.,0.,0.)); 15#2=CARTESIAN_POINT('pt',(1.,0.,0.)); 16#3=DIRECTION('xdir',(1.,0.,0.)); 17#4=DIRECTION('zdir',(0.,0.,1.)); 18#5=GEOMETRIC_CURVE_SET('newline-header-shape',()); 19ENDSEC; 20END-ISO-10303-21;