
Thu, 10/26/2017 - 11:00
Hi,
we're writing a module that uses OpenCascade 7.2 in a dynamic loaded DLL.
This module simply reads a STEP or IGES using STEPCAFControl_Reader and IGESCADControl_Reader.
All works but unloading DLL I have an Unhandled exception (Access violation) in
TKXSBase.dll!StepData_GlobalNodeOfWriterLib::~StepData_GlobalNodeOfWriterLib() C++
TKXSBase.dll!StepData_GlobalNodeOfWriterLib::`scalar deleting destructor'(unsigned int) C++
TKXSBase.dll!StepData_GlobalNodeOfWriterLib::~StepData_GlobalNodeOfWriterLib() C++
TKXSBase.dll!StepData_GlobalNodeOfWriterLib::`scalar deleting destructor'(unsigned int) C++
TKXSBase.dll!`dynamic atexit destructor for 'theglobal''() C++
> TKXSBase.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 416 C
TKXSBase.dll!__DllMainCRTStartup(void * hDllHandle=0x00007ffce46a0000, unsigned long dwReason=0, void * lpreserved=0x00000056e81fea80) Line 522 C
it happens everytime I declare an object STEPCAFControl_Reader or IGESCAFControl_Reader. It happens also if the only code executed by DLL is a declaration like
STEPCAFControl_Reader reader;
Same code in an EXE works fine without problem.
Someone have an Idea?
I attached wizard generated solution (Vs 2012) to test it.
Thank you
Tue, 11/27/2018 - 17:53
Hi,
We have exactly the same problem. Any suggestions were appreciated
Mon, 08/17/2020 - 19:56
Hi,
I too have exactly the same problem.
One interesting thing I noticed, if I set the order of the libraries on CMakeLists differently, the access violation happens at a different library. Depending on which is loaded first, the error happens either on TKXSBase.dll or TKXDESTEP.dll. Both at StandardHandle::EndScope;
My suspicion is that there is a race condition happening when deleting pointers on shutdown.
Any plan on when this problem will be addressed?
Thu, 08/20/2020 - 15:15
If analysis shows that the problem is within OCCT itself, then as first step it is necessary reporting an issue on Bugtracker (with a reproducer).
And suggestions or patches fixing the issue are welcome, of course.