
Mon, 02/10/2025 - 15:50
Hi everyone,
I'm converting STEP files to GLB using OpenCascade. However, I’m encountering a segmentation fault during conversion with certain STEP files. However, if I open the problematic STEP file in CAD Assistant and then re-export it, the resulting file converts without any issues.
I ran gdb and got the following error:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff735dab6 in STEPCAFControl_Reader::fillAttributes(opencascade::handle<XSControl_WorkSession> const&, opencascade::handle<StepRepr_PropertyDefinition> const&, StepData_Factors const&, opencascade::handle<TDataStd_NamedData>&) const () from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
#0 0x00007ffff735dab6 in STEPCAFControl_Reader::fillAttributes(...) from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
#1 0x00007ffff735f6ce in STEPCAFControl_Reader::ReadMetadata(...) from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
#2 0x00007ffff7362256 in STEPCAFControl_Reader::Transfer(STEPControl_Reader&, int, opencascade::handle<TDocStd_Document> const&, NCollection_Sequence<TDF_Label>&, bool, Message_ProgressRange const&) () from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
#3 0x00007ffff7362c88 in STEPCAFControl_Reader::Transfer(opencascade::handle<TDocStd_Document> const&, Message_ProgressRange const&) () from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
Does anyone have any insights into why the original STEP file might be causing a segfault? Could it be an issue with the file’s metadata? Any ideas on how to diagnose or resolve this would be greatly appreciated!
Thanks in advance!
Mon, 02/10/2025 - 16:47
Hello. It can be a new bug. Could you please share a file? If it is not public, please create a request with "Contact us" form.
Without file it id not possible to help. But you can disable reading of metada for example.
If you share the file during few closest days, the fix will be ready up to 17.02.
Best regards, Dmitrii.
Mon, 02/10/2025 - 18:34
If still not possible to share - could you please check that path? Data Exchange - Step Import metadata crash protecting
Can be downloaded by artefact: Artefacts Data Exchange - Step Import metadata crash protecting
Best regards, Dmitrii.
Tue, 02/11/2025 - 12:39
Hi Dmitrii,
Unfortunately, I’m unable to share the file with you at this time. However, I tested it with STEPControl_Reader, and it worked fine. The issue arises when I try to preserve the assembly structure, color, and naming information using STEPCAFControl_Reader, as it results in a segmentation fault.
For context, these STEP files are generated from Creo and Solid Edge software, and some are converted from JT to STEP. Given their complex assembly structures with material and color information, this might be a factor in the issue.
Let me know if you have any insights on this!
Regards,
Amar
Tue, 02/11/2025 - 12:41
Hello, unfortunately, it is not very useful in current case. Please validate your reading with my patch or use debug OCCT version with gdb to collect and share stack.
The sample how to build: OCCT/.github/workflows/build-multiconfig-ubuntu.yml at master · Open-Cascade-SAS/OCCT
Best regards, Dmitrii.
Tue, 02/11/2025 - 14:29
Hello,
I applied your patch, but I encountered a build error:
OCCT/src/STEPCAFControl/STEPCAFControl_Reader.cxx:5853:30: error: ‘ProcessingFlags’ in ‘class XSAlgo_ShapeProcessor’ does not name a type
5853 | const XSAlgo_ShapeProcessor::ProcessingFlags& STEPCAFControl_Reader::GetShapeProcessFlags() const
| ^~~~~~~~~~~~~~~
make[2]: *** [src/TKDESTEP/CMakeFiles/TKDESTEP.dir/build.make:132: src/TKDESTEP/CMakeFiles/TKDESTEP.dir/__/STEPCAFControl/STEPCAFControl_Reader.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2566: src/TKDESTEP/CMakeFiles/TKDESTEP.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
It seems that ProcessingFlags is not recognized within XSAlgo_ShapeProcessor. Could you take a look at this issue and advise on how to resolve it?
Thank you,
Amar
Tue, 02/11/2025 - 14:34
You apply my patch on old version. Please cherry pick to the branch and compile. It is 7.9.0 beta2 patch and just cherry picking will be diffucult to inject.
Tue, 02/11/2025 - 14:36
Well Okay, Thank you for your prompt response. I will check with 7.9.0 beta2 version
Tue, 02/11/2025 - 14:39
The correct branch located in that remote: dpasukhi/OCCT at stp_metadata_prot You can "git remote set-url temp_repo https://github.com/dpasukhi/OCCT.git" "git checkout temp_repo/stp_metadata_prot"
Tue, 02/11/2025 - 14:41
Or in case if you want to check on old version. Manually copy-past the whole function at the end of the StepCafControl_Reader.cxx file. It originally must be easy-replaced.
Note, the patch still not in master, it is still waiting for integration.
Tue, 02/11/2025 - 16:41
Hello, I tried with this branch. However, I am getting the similar error.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7232ab6 in STEPCAFControl_Reader::fillAttributes(opencascade::handle<XSControl_WorkSession> const&, opencascade::handle<StepRepr_PropertyDefinition> const&, StepData_Factors const&, opencascade::handle<TDataStd_NamedData>&) const ()
from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
(gdb) bt full
#0 0x00007ffff7232ab6 in STEPCAFControl_Reader::fillAttributes(opencascade::handle<XSControl_WorkSession> const&, opencascade::handle<StepRepr_PropertyDefinition> const&, StepData_Factors const&, opencascade::handle<TDataStd_NamedData>&) const ()
from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
No symbol table info available.
#1 0x00007ffff72346ce in STEPCAFControl_Reader::ReadMetadata(opencascade::handle<XSControl_WorkSession> const&, opencascade::handle<TDocStd_Document> const&, StepData_Factors const&) const () from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
No symbol table info available.
#2 0x00007ffff7237256 in STEPCAFControl_Reader::Transfer(STEPControl_Reader&, int, opencascade::handle<TDocStd_Document> const&, NCollection_Sequence<TDF_Label>&, bool, Message_ProgressRange const&) () from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
No symbol table info available.
#3 0x00007ffff7237c88 in STEPCAFControl_Reader::Transfer(opencascade::handle<TDocStd_Document> const&, Message_ProgressRange const&) ()
from /usr/local/opencascade/lib/libTKDESTEP.so.7.8
No symbol table info available.
Tue, 02/11/2025 - 16:43
in that case please compile debug version and share the gdb stack (with line of crash)
Tue, 02/11/2025 - 16:50
Hello,
I have compiled in Debug mode and the error I mentioned before is the GDB backtrace from the crash.
Please let me know if you need additional details or further debugging steps if I am missing anything.
Thanks,
Amar
Tue, 02/11/2025 - 16:58
Unfortunatelly, that log is not detailed. The function is huge and it will not help to define the issue. Please prepare more detailed dump with line of crash. Without file or detailed stack no option to help or fix.
And you still working with old version. Not 7.9