xBimTeam / XbimGeometry

XbimGeometry contains the CLR interop libraries and the c++ engine used to compute the 3D geometry of models.
https://xbimteam.github.io/
Other
260 stars 131 forks source link

Error in Xbim3DModelContext.CreateContext() terminates process #359

Closed rainer-helbing closed 3 years ago

rainer-helbing commented 3 years ago

Xbim3DModelContext.CreateContext() crashes while processing the shapes of an IFC file. The error (stack overflow or access violation) causes the whole process to terminate.

Assemblies and versions affected:

Xbim.Geometry 5.1.324 and also Xbim.Geometry 5.1.329

Steps (or code) to reproduce the issue:

    using (IfcStore model = IfcStore.Open("geb600.ifc", null, -1)) {
        Console.WriteLine("create geometry context");
        Xbim3DModelContext context = new Xbim3DModelContext(model);
        context.CreateContext();
        Console.WriteLine("create geometry context done");
    }

Minimal file to reproduce the issue:

I was not able to upload the zipped IFC file to github. Please use geb600.zip instead.

Expected behavior:

CreateContext finishes correctly or with an C# exception that can be caught by the caller.

Actual behavior or exception details:

version 5.1.329 - CreateContext produces a stackoverflow exception version 5.1.324 - CreateContext produces an access violation

Additional Details

The error occurs while processing the shape with id 110554 belonging to opening 2_oWz1KUf1tgA9HFpJNoVG.

rainer-helbing commented 3 years ago

While browsing through the open Xbim.Geometry issues I found a workaround by @CBenghi in #281. Changing the precision manually in IFCGEOMETRICREPRESENTATIONCONTEXT helped me as well.

I hope someone from the Xbim team finds time to fix CreateContext to handle this error gracefully.

Janitum commented 2 years ago

Hi, I stumbled upon the exact same issue. Graceful exception handling would be much appreciated indeed!