step-examples/12-1b-header/Lh050.stp
Sources
- OCCT V8.0.0 (FreeBSD `timezone` global variable: `long timezone` declaration conflicts with POSIX `extern long timezone`, producing garbage UTC offset on FreeBSD). B4 wave-5 DEF-R (LGPL-clean — pattern only, no bytes copied).
Description
STEP AP203 file with a `FILE_NAME` header record where the timestamp field contains a deliberately malformed `DATE_AND_TIME` value (`-9999-99-99T99:99:99+9999:99`) synthesizing what the FreeBSD timezone-declaration bug produced: the `timezone` global (`long timezone`) was declared without `extern` in a local header, conflicting with the POSIX `extern long timezone` prototype; on FreeBSD this yielded a garbage UTC-offset value that, when formatted as ISO 8601, produced an entirely out-of-range date string (negative year, month/day/hour/minute > valid range). The DATA section contains a valid minimal planar face geometry so geometry-loading tests can confirm the reader proceeds despite the malformed header date. The `FILE_SCHEMA` uses `CONFIG_CONTROL_DESIGN` (AP203 1994) to test legacy-schema tolerance simultaneously.
Reproducer recipe
`FILE_NAME('Lh050.stp','-9999-99-99T99:99:99+9999:99',(''),(''),...)` with `FILE_SCHEMA(('CONFIG_CONTROL_DESIGN'))` and a valid `OPEN_SHELL` planar face in the DATA section. OCCT loads nothing (header schema not recognized + no PRODUCT chain); strict parsers may emit `W_MALFORMED_DATE`.
Expected kernel behavior
geometry-reading proceeds despite invalid header date; strict ISO 8601 parsers emit `W_MALFORMED_DATE` and continue; no crash; STEP header date fields are non-critical for geometry semantics; `CONFIG_CONTROL_DESIGN` schema string triggers `W_LEGACY_SCHEMA`.
Notes
DEF-R is platform-specific (FreeBSD-only): the fixture synthesizes the byte pattern the bug produced without relying on a FreeBSD build environment. Distinct from Lh040 (FILE_INFO date contradiction) and Lh016 (wrong timezone format). OCCT V8.0.0 fixes the `extern long timezone` declaration. Synonyms: "FreeBSD STEP timezone bug", "DATE_AND_TIME malformed negative year STEP", "OCCT FreeBSD timezone declaration", "STEP header garbage date FreeBSD", "FILE_NAME timestamp out-of-range year".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'FILE_NAME')contains(b'-9999-99-99')contains(b"'-9999-99-99T99:99:99+9999:99'")
Tier-3 assertions
load == "ok"shape_null == True
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/* Lh050: malformed DATE_AND_TIME in FILE_NAME header â FreeBSD timezone bug */ 3/* DEFECT: 'long timezone' vs 'extern long timezone' declaration mismatch on FreeBSD */ 4/* produces garbage UTC offset; synthesized as explicit out-of-range date string */ 5/* OCCT V8.0.0 fixes: https://github.com/Open-Cascade-SAS/OCCT/releases */ 6/* Expected: geometry loads; strict parsers emit W_MALFORMED_DATE; no crash */ 7HEADER; 8FILE_DESCRIPTION(('Lh050: malformed header DATE_AND_TIME (FreeBSD timezone bug)'),'2;1'); 9/* DEFECT: next line has malformed timestamp with garbage timezone offset */ 10FILE_NAME('Lh050.stp','-9999-99-99T99:99:99+9999:99',(''),(''),'cad-research-suite','FreeBSD/OCCT-7.x-timezone-bug',''); 11FILE_SCHEMA(('CONFIG_CONTROL_DESIGN')); 12ENDSEC; 13DATA; 14#1=CARTESIAN_POINT('',(0.,0.,0.)); 15#2=CARTESIAN_POINT('',(10.,0.,0.)); 16#3=CARTESIAN_POINT('',(10.,10.,0.)); 17#4=CARTESIAN_POINT('',(0.,10.,0.)); 18#5=DIRECTION('',(1.,0.,0.)); 19#6=DIRECTION('',(0.,1.,0.)); 20#7=DIRECTION('',(0.,0.,1.)); 21#8=VECTOR('',#5,10.); 22#9=VECTOR('',#6,10.); 23#10=LINE('',#1,#8); 24#11=LINE('',#2,#9); 25#12=VECTOR('',#5,10.); 26#13=LINE('',#4,#12); 27#14=VECTOR('',#6,10.); 28#15=LINE('',#1,#14); 29#16=VERTEX_POINT('',#1); 30#17=VERTEX_POINT('',#2); 31#18=VERTEX_POINT('',#3); 32#19=VERTEX_POINT('',#4); 33#20=EDGE_CURVE('',#16,#17,#10,.T.); 34#21=EDGE_CURVE('',#17,#18,#11,.T.); 35#22=EDGE_CURVE('',#19,#18,#13,.T.); 36#23=EDGE_CURVE('',#16,#19,#15,.T.); 37#24=ORIENTED_EDGE('',*,*,#20,.T.); 38#25=ORIENTED_EDGE('',*,*,#21,.T.); 39#26=ORIENTED_EDGE('',*,*,#22,.F.); 40#27=ORIENTED_EDGE('',*,*,#23,.F.); 41#28=EDGE_LOOP('',(#24,#25,#26,#27)); 42#29=AXIS2_PLACEMENT_3D('',#1,#7,#5); 43#30=PLANE('',#29); 44#31=FACE_OUTER_BOUND('',#28,.T.); 45#32=ADVANCED_FACE('',(#31),#30,.T.); 46#33=OPEN_SHELL('',(#32)); 47#34=SHELL_BASED_SURFACE_MODEL('',(#33)); 48ENDSEC; 49END-ISO-10303-21;