opensourceBIM / BIMserver

The open source BIMserver platform
GNU Affero General Public License v3.0
1.54k stars 608 forks source link

Getting stuck on geometry generation #760

Closed jonasmanuel closed 6 years ago

jonasmanuel commented 6 years ago
Bimserver version: 1.5.101 (and older from sporadic tests)
Render engine name IfcOpenShell
Render engine version IfcOpenShell-0.5.0-dev-2
Render engine plugin version 0.5.26

Server is a CentOs 7 virtual server, but this behaviour was also seen on ubuntu and windows installations.

The error file:

error.ifc This file was created as a debug output from parsing the architect2.ifc file. (The error also occurs with the architect.ifc file from the same project.)

Error description

When I checkin this file on our server installation, the file uploads fine, but then the geometry generation runs to almost 100% and then stays there forever.

If the original file (architect2.ifc) is used, the generation stops somewhere in the middle. I can only get it to finish if I kill the IfcGeomServer process several times in a row. This will make the generation finish but the resulting rendering looks weird: image

Is this a known problem? Since the problematic file is one of your projects provided example files... Any help or pointers would be appreciated.

We are unsure if this is a problem with just this particular file, or if this could also appear in other files: if so is there anything we can do to fix/detect it before it effectively DOSes our server?

If it is a problem with the BimServer of IfcOpenshell plugin, is there any way I could attempt a fix/ debug more closely (I am not super familiar with the geometry generation process so I dont know how/where to start).

Debug Info

There is an error in the Geometry generation report but I guess this is just from me killing the IfcGeomServer process: org.bimserver.plugins.renderengine.RenderEngineException: Exited with non-zero exit code: 143 at org.ifcopenshell.IfcGeomServerClient.terminate(IfcGeomServerClient.java:496) at org.ifcopenshell.IfcGeomServerClient.close(IfcGeomServerClient.java:47) at org.ifcopenshell.IfcOpenShellEngine.close(IfcOpenShellEngine.java:82) at org.bimserver.renderengine.NoPoolingRenderEnginePool.returnObject(NoPoolingRenderEnginePool.java:40) at org.bimserver.geometry.GeometryRunner.run(GeometryRunner.java:578) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

While the process is running it maxes out its cpu core to nearly 100% so i suspect some sort of infinite loop?

rubendel commented 6 years ago

Thanks for taking the effort of writing a quality bug report!

It could be a memory problem (is the memory for either the BIMserver or the IfcGeomServer process (or combined) near the limit of the machine?).

I'll try the model today on a windows machine. There should be a geometry generation report linked to the revision as extended data, can you post that as well?

rubendel commented 6 years ago

I can reproduce this on a windows machine. The problem seems to be in IfcOpenShell. BIMserver generates small intermediate files to send to IfcOpenShell. All the files that solely contain IfcOpeningElement objects indeed seem to result in an endless loop. The files themselves are only 8kb and contain only extrusions.

It could be that BIMserver generates these files incorrectly, but IfcOpenShell should give an error message or return no geometry. I have submitted an issue on the IfcOpenShell tracker: https://github.com/IfcOpenShell/IfcOpenShell/issues/390

jonasmanuel commented 6 years ago

here are the generation reports for the error.ifc file geometryGenerationReport.zip and the original file: architect2-report.zip

the server currently only has about 4GB Ram however i already tested on my windows machine with 32GB with the same results

rubendel commented 6 years ago

This was a specific problem for IfcOpeningElements, BIMserver did not include all the required objects in the IFC file.

More details in https://github.com/IfcOpenShell/IfcOpenShell/issues/390.

This will be in the next release. Linked file uploads just fine now. Thanks again for the clear report.

jonasmanuel commented 6 years ago

Cool glad to hear that!