#33058·FreeCAD

OCC: Documents with infinite geometry fail to reopen after OCCT 8.0.1 update (OCCT#1560)

Author: waynepiekarskiCreated Sep 29, 2026Updated Sep 30, 2026
Labels3rd party: OCCType: RegressionStatus: Confirmed

Problem description

I have a FCStd that is failing to load in FreeCAD weekly 2026.09.23, which bundles OCCT 8.0.1. This was previously working fine with FreeCAD weekly 2026.08.05, which bundled OCCT 7.8.1.

My understanding is that FreeCAD writes the .brp files inside its documents in fixed notation with 17 decimals. Precision::Infinite() (2e+100), which ends up as a trim bound of a Geom_RectangularTrimmedSurface over an infinite cylinder, is then written as a 119-character token:

      10 0 3.1415926535897931 -20000000000000000318057822195198360936721617127890562779562655115495677544340762121626939971713630208.00000000000000000 2000...

Once the token is split, the rest of the record is parsed out of sync, and then crashes:

  - `BRepTools::Read` crashes in `Geom_RectangularTrimmedSurface`'s constructor (null basis surface):
    #0 Geom_RectangularTrimmedSurface::Geom_RectangularTrimmedSurface(...)   libTKG3d.so.8.0
    #1 GeomTools_SurfaceSet::ReadSurface(std::istream&)                       libTKGeomBase.so.8.0
    #2 GeomTools_SurfaceSet::Read(std::istream&, Message_ProgressRange const&)
    #3 BRepTools_ShapeSet::ReadGeometry(...)
    #4 TopTools_ShapeSet::Read(...)
    #5 BRepTools::Read(TopoDS_Shape&, char const*, BRep_Builder const&, ...)

I made this patch on GetReal which uses an arbitrary string buffer and tested it and it works fine.

    void GeomTools::GetReal(std::istream& IS, double& theValue)
    {
      theValue = 0.;
      if (IS.eof())
        return;
      std::string aToken;
      IS >> aToken;
      theValue = Strtod(aToken.c_str(), nullptr);
    }

This issue is currently mentioned on https://github.com/Open-Cascade-SAS/OCCT/issues/1560

Workbench affected?

No response

Steps to reproduce

Load in a FCStd which has infinite geometry, which exceeds the existing GetReal string buffer.

Expected behavior

OCCT 8.0.1 should handle this the same as OCCT 7.8.1

Actual behavior

Crashes in FreeCAD weekly 2026.09.23

Development version About Info (in Safe Mode)

bash
Fails in 2026.09.23
Works in 2026.08.05
Linux Debian 13.

Last known good version (optional)

bash
Works in 2026.08.05