Le058 — Final record before `ENDSEC;` lacks trailing newline at EOF

§12.1a encoding/strings (sub-class: end-of-record / EOF framing)

P1 — silent data loss

spec-violation encoding

Sources

Sender

deduced — producers that write the file body byte-for-byte without an explicit final newline; some streaming writers that flush before the trailing `\n` is queued

Description

ISO 10303-21 §6.2 specifies that a record is terminated by `;`; the spec is silent on whether a trailing newline is required after the final `;` of the file. A producer may emit `..);ENDSEC;END-ISO-10303-21;` with no newline anywhere, or with the final newline omitted. POSIX tools that read line-by-line (and strict line-buffered tokenisers) drop the last line if it lacks a `\n` — the final record (or the `END-ISO-10303-21;` terminator) is silently lost, and the receiver reports a file that is structurally short by one record. The cousin defect is a missing newline between the last DATA-section record and `ENDSEC;` — `..);ENDSEC;` with no separator at all is allowed by the grammar but trips lexers that scan to end-of-line for an `ENDSEC` keyword. Bug-reporter language: "STEP file missing trailing newline", "last record dropped on load", "ENDSEC on same line as last record".

Reproducer recipe

a file whose byte stream ends `..#19=EDGE_LOOP('',(#18));ENDSEC;END-ISO-10303-21;` with NO trailing `\n` and NO newline between the last record and `ENDSEC;`. The fixture is byte-exact at EOF.

Expected kernel behavior

Heal and accept: tokenise on `;` alone; treat EOF as a valid record-and-section terminator if the preceding `;`-terminated record has been seen. Never require a trailing newline. Lexers that scan line-by-line should be replaced or wrapped with a `;`-aware preprocessor. Do not reject missing-trailing-newline files.

Notes

Companion to Le056 / Le057 (other EOR variants). **See also**: Le054, Le056, Le057. Synonyms: "no newline at EOF in STEP", "ENDSEC without preceding newline", "POSIX-incomplete final line in Part-21".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Cross-references

Le054, Le056, Le057

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ISO-10303-21;
2/* Le058: Final record before ENDSEC lacks trailing newline at EOF; ISO 10303-21 §6.2: record terminator is ';'; spec is silent on whether a trailing newline is required after the final ';'; a producer may emit the file body ending in );ENDSEC;END-ISO-10303-21; with no trailing newline anywhere; POSIX tools that read line-by-line drop the last line if it lacks a newline — the final record or the END-ISO-10303-21; terminator is silently lost; cousin defect: missing newline between the last DATA-section record and ENDSEC; receiver must tokenise on ';' alone; treat EOF as a valid record-and-section terminator if the preceding ';'-terminated record has been seen; never require a trailing newline; lexers that scan line-by-line should be replaced or wrapped with a ';'-aware preprocessor; do not reject missing-trailing-newline files; sibling of Le056/Le057; see also Le054; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('Le058'),'2;1');
5FILE_NAME('Le058.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#1=CARTESIAN_POINT('',(0.0,0.0,0.0));
10#2=GEOMETRIC_CURVE_SET('',(#1));
11#8999=PERSON('no-trailing-newline-defect','eof-without-lf','');ENDSEC;END-ISO-10303-21;