Application crashes when importing this specific IFC file.

Tried importing this particular IFC files in multiple (online / desktop) IFC viewers and almost all applications crashed. Even ‘ifcviewer-C++_64bit_Unicode.exe’ crashes. After investigating it was found that ‘stack overflow’ exception is thrown from IFCEngine.dll (version while executing ‘getInstanceDerivedTransformationMatrix’ API.
Tried to handle this crash using try-catch exception handling but it did not catch the exception because it is ‘operating system’ level exception and not C++ exception.


Need help in solving this exception on IFCEngine side.

PS: Currently this forum doesn’t allow me to upload the IFC file as I am a new user. Will upload the file as soon as it allows me to do so.

IFC uses relative placements. Is there any chance there is a cyclic definition in the model that causes an infinite loop when evaluating (hence a stack overflow)? That’s what I would piece together from the information provided.

If that were the case, the following python script would also overflow the stack:

import ifcopenshell
f =
for inst in f.by_type('IfcObjectPlacement'):
1 Like

Thanks for your reply Thomas :+1:t2: Even I am guessing that file has something cyclic in it. The file is so big that its difficult to find the possible cyclic structure in it. Some how I am not able to provide the file (because of the restriction imposed by buildingsmart of uploading file to new users).
I forgot to mention that I am using C++ and the exception caught by the API getInstanceDerivedTransformationMatrix is not caught in try catch expression. Is there any alternative for above API? or any newer version of IFCEngine.dll which has handled this kind of exception inside IFCEngine code? any more information is appreciated…

Keep in mind that this a forum generically about IFC not about any particular implementation. @PeterBonsma will be able to tell you more about IFCEngine.dll but indeed a stack overflow exception in native code cannot be handled. If the issue is not due to infinite recursion you can increase the size of the stack (in windows I think this is a compile time setting, on linux I think runtime).

1 Like

@OmkarShembekar, if you could send the IFC file to me ( I can have a look. It could be indeed many things, including a bug on our side.


1 Like

Sure Peter. I will send the file directly to you. Thanks for the help.

Sure. Thanks Thomas for pointing me to the correct person. Appreciate your time and help.

Generally, please note that IFC4x1 is withdrawn.
Can you change to IFC4 ADD2 TC1 or at least IFC4.3 TC1?

1 Like

@igor.sokolov , @aothms - This issue was resolved with the latest IFCEngine.dll (version 1606). Thanks to @PeterBonsma for the solution :+1:t2: