Before I start to describe my problem, I'd like to say that I really enjoy FreeCAD and the work done by the developers. Great software, especially the Python interface!
I will try to give as many details as possible. If some things are missing, let me know and I will add them
Very high level
: I use a python script (no gui) to import an assembly in the step format (see stp file attached) and then read the parts in order to build a tree. This script works perfectly fine with FreeCAD 0.18, but does not work with FreeCAD 0.19 because of a segmentation fault.
: I am using Docker containers. One for each version so everything is independant and there is no clash between both versions. Here is the information I printed from the console. Please note that I am also able to reproduce my issue on Windows, so the OS seems to be irrelevant.
BuildRevision: 16146 (Git)
BuildRevisionDate: 2019/10/22 16:53:35
BuildRevisionBranch: HEAD detached at 0.18.4
Python version: 3.6.9
OCC Version: 7.3.0
BuildRevision: 24291 (Git)
BuildRevisionDate: 2021/04/15 09:17:08
BuildRevisionBranch: HEAD detached at 0.19.2
Python version: 3.8.10
OCC Version: 7.4.0
BuildRevision: 25025 (Git)
BuildRevisionDate: 2021/06/04 16:30:30
Python version: 3.9.5
OCC Version: 7.5.2
More detailed description of my issue
The command I use to import my step file is: Import.open(path_to_file). I attached the result that I get with 0.18 (Cylinders-018.txt). That result file is a list of the parts in the model and is autogenerated by my script with the information retrieved from the FreeCAD import. For testing purposes, you can use the python command FreeCAD.ActiveDocument.Objects to see the list of imported objects.
Now, when I switch to 0.19 and run the exact same script with the same input file, I get a segmentation fault. The console only prints Segmentation Fault without more details though. If there is a way to get the error code, please let me know and I will add it. There was a similar issue raised a couple months ago: https://forum.freecadweb.org/viewtopic.php?f=19&t=49243
. They suggested a workaround and with that workaround, the file can be imported without the segfault, but all the children information is lost (which makes sense, because the workaround is to set ReadShapeCompoundMode to False, see file Cylinders-019.txt) and unfortunately, this is not the behavior that I am looking for. I would expect the import command to work with both ReadShapeCompoundMode set to True or False and I would expect the results to be the same for 0.18 and 0.19.
Please note that I am able to reproduce this issue with all the 0.19 versions that I've tried (so far). So I do not think that it is tied to the specific version above. I am also able to reproduce the issue with other stp models that are assemblies.
Let me know if you want me to provide more details.
Thanks a lot for your time!