Thu, 03/07/2024 - 17:56
After sucessfull reading a IGES file, my application crashes on cleaning up.
Environment:
Visual Studio 2022
Version 17.9.2
OCCT via vcpkg
Windows 11
compiled with cpplatest
Usage,
IGESControl_Reader myIgesReader;
myIgesReader.ReadFile ("c:\\temp\\filge.igs");
Crash in Standard_Type.cxx
Standard_Type::~Standard_Type ()
{
// remove descriptor from the registry
registry_type& aRegistry = GetRegistry();
Standard_ASSERT(aRegistry.erase(myInfo) > 0, "Standard_Type::~Standard_Type() cannot find itself in registry",);
}
while the registry contains 225 items uppon begin of clean up. This code crashes when reaching first added 149 items
Ausgelöste Ausnahme: Lesezugriffsverletzung
"this->_Vec._Mypair._Myval2.**_Myfirst**" war "0x11101110111091A".
Alle Items added via e.g. atype01 = STANDARD_TYPE(IGESGeom_BSplineCurve); are no longer valid in the registry uppon clean up
Callstack
> cirosPluginOCImportWorker.exe!std::_Hash<std::_Umap_traits<std::type_index,Standard_Type *,std::_Uhash_compare<std::type_index,std::hash<std::type_index>,std::equal_to<std::type_index>>,std::allocator<std::pair<std::type_index const ,Standard_Type *>>,0>>::_Find_last<std::type_index>(const std::type_index & _Keyval={...}, const unsigned __int64 _Hashval=13812902102746794112) Zeile 1565 C++
cirosPluginOCImportWorker.exe!std::_Hash<std::_Umap_traits<std::type_index,Standard_Type *,std::_Uhash_compare<std::type_index,std::hash<std::type_index>,std::equal_to<std::type_index>>,std::allocator<std::pair<std::type_index const ,Standard_Type *>>,0>>::_Erase<std::type_index>(const std::type_index & _Keyval={...}) Zeile 1109 C++
cirosPluginOCImportWorker.exe!std::_Hash<std::_Umap_traits<std::type_index,Standard_Type *,std::_Uhash_compare<std::type_index,std::hash<std::type_index>,std::equal_to<std::type_index>>,std::allocator<std::pair<std::type_index const ,Standard_Type *>>,0>>::erase(const std::type_index & _Keyval={...}) Zeile 1137 C++
cirosPluginOCImportWorker.exe!Standard_Type::~Standard_Type() Zeile 106 C++
cirosPluginOCImportWorker.exe!Standard_Type::`scalar deleting destructor'(unsigned int) C++
cirosPluginOCImportWorker.exe!Standard_Transient::Delete() Zeile 111 C++
cirosPluginOCImportWorker.exe!opencascade::handle<Standard_Type>::EndScope() Zeile 387 C++
cirosPluginOCImportWorker.exe!opencascade::handle<Standard_Type>::~handle<Standard_Type>() Zeile 82 C++
cirosPluginOCImportWorker.exe!`dynamic atexit destructor for 'atype16''() C++
ucrtbased.dll!00007ff98aa72c21() Unbekannt
Works fine with OCCT 7.7.0
Thu, 03/07/2024 - 18:00
Maybe having statics
static Handle(Standard_Type) atype01,atype02,atype03,atype04,atype05,atype06,
atype07,atype08,atype09,atype10,atype11,atype12,atype13,atype14,atype15,
atype16,atype17,atype18,atype19,atype20,atype21,atype22,atype23;
and
// To initialize theRegistry map as soon as possible to be destroyed the latest
Handle(Standard_Type) theType = STANDARD_TYPE(Standard_Transient);
conflicts
Thu, 03/07/2024 - 18:17
Hi, Thank you for the report. We will investigate the issue. The problem is clear. It can be a regression from 7.8.
Best regards, Dmitrii.
Thu, 03/07/2024 - 18:24
If it important for you project, please revert changes for next files(from 33370 issue):
src\Standard\Standard_Type.cxx
src\Standard\Standard_Type.hxx
For now we need to investigate the problem reason more deep. How are you use IGES reader, is it in your project that have linked IGES lib as shared or static lib?
Best regards, Dmitrii.
Fri, 03/08/2024 - 09:37
Thanks for the comments,
Actual the IGES Reader is within an extra executable, with IGES lib as static libs, so i can handle the crash exit code within our application.
Due to the fact, we are using vcpkg in manifest mode we cannot revert the changes
Sun, 03/10/2024 - 14:29
Thank you. My apologies. We will update those files in master branch soon. And check option to include into maintenance with binary capability,
Best regards, Dmitrii.
Thu, 03/28/2024 - 13:04
Issue: 0033656: Foundation Classes - Standard_Type crash during unloading static lib - MantisBT (opencascade.org)
Will be fixed in maintance release 7.8.1 (soon).
Tue, 05/07/2024 - 16:15
Any news? 7.8.1 still crashes
Tue, 05/07/2024 - 16:47
7.8.1 from tag or develop version?
Best regards, Dmitrii.
Tue, 05/07/2024 - 16:52
7.8.1 via vcpkg
Tue, 05/07/2024 - 17:11
My apologies, I will try to check the problem. But only one thing I can do - prepare fix for the 7.8.2 release.
Best regards, Dmitrii.
Wed, 05/08/2024 - 11:17
The file date of the files within vcpkg\buildtrees\opencascade\src\V7_8_1-7b8b64e634.clean\src\Standard is 01.04.2024
The Crash is again in aRegistry.erase
Standard_Type::~Standard_Type ()
{
// remove descriptor from the registry
registry_type& aRegistry = GetRegistry();
Standard_ASSERT(aRegistry.erase(myName) > 0, "Standard_Type::~Standard_Type() cannot find itself in registry",);
Standard::Free (myName);
}
with
myName = "IGESBasic_SubfigureDef"
Mon, 07/29/2024 - 13:36
Any updates?
Mon, 07/29/2024 - 14:09
It is can't be updated on maintenance path. It is partially resolved on patch for 7.9. My apologies. The changes for 7.9. will be pushed a little later.
Best regards, Dmitrii.