OCCT 7.8.0 crashes on termination after reading a IGES file

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

Thorsten Koch's picture

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

Dmitrii Pasukhin's picture

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.

Dmitrii Pasukhin's picture

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.

Thorsten Koch's picture

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

Dmitrii Pasukhin's picture

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.

Dmitrii Pasukhin's picture
Thorsten Koch's picture

Any news? 7.8.1 still crashes

Dmitrii Pasukhin's picture

7.8.1 from tag or develop version?

Best regards, Dmitrii.

Thorsten Koch's picture

7.8.1 via vcpkg

Dmitrii Pasukhin's picture

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.

Thorsten Koch's picture

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"