Page MenuHomePhabricator

Workbench crashes on application shutdown
Closed, ResolvedPublic

Description

Seems to be related to the extapplication plugin:

	0000000000000000()	Unknown
	msvcp120d.dll!000007feeeadce99()	Unknown

liborg_blueberry_core_runtime.dll!std::basic_filebuf<char,std::char_traits<char> >::_Initcvt(const std::codecvt<char,char,int> * _Newpcvt) Line 672 C++

	liborg_blueberry_core_runtime.dll!std::basic_filebuf<char,std::char_traits<char> >::open(const char * _Filename, int _Mode, int _Prot) Line 271	C++
	liborg_blueberry_core_runtime.dll!std::basic_ofstream<char,std::char_traits<char> >::open(const char * _Filename, int _Mode, int _Prot) Line 1077	C++
	liborg_blueberry_core_runtime.dll!berry::XMLPreferencesStorage::Flush(berry::IPreferences * __formal) Line 103	C++
	liborg_blueberry_core_runtime.dll!berry::Preferences::Flush() Line 146	C++
	liborg_blueberry_core_runtime.dll!berry::PreferencesService::ShutDown() Line 175	C++
	liborg_blueberry_core_runtime.dll!berry::PreferencesService::~PreferencesService() Line 86	C++
	[External Code]	
	liborg_blueberry_osgi.dll!berry::Object::UnRegister(bool del) Line 115	C++
	liborg_blueberry_ui.dll!berry::SmartPointer<berry::IPreferencesService>::UnRegister() Line 316	C++
	liborg_blueberry_ui.dll!berry::SmartPointer<berry::IPreferencesService>::~SmartPointer<berry::IPreferencesService>() Line 126	C++
	[External Code]	
	liborg_mitk_gui_qt_extapplication.dll!QmitkExtApplicationPlugin::~QmitkExtApplicationPlugin() Line 43	C++
	[External Code]	
	Qt5Cored.dll!QLibraryPrivate::unload(QLibraryPrivate::UnloadFlag flag) Line 548	C++
	Qt5Cored.dll!QLibraryStore::cleanup() Line 399	C++
	Qt5Cored.dll!qlibraryCleanup() Line 419	C++
	Qt5Cored.dll!`anonymous namespace'::qlibraryCleanup_dtor_class_::~qlibraryCleanup_dtor_class_() Line 420	C++
	[External Code]

Event Timeline

Cleaned stack trace:

berry::XMLPreferencesStorage::Flush(berry::IPreferences * __formal) Line 103
berry::Preferences::Flush() Line 146
berry::PreferencesService::ShutDown() Line 175
berry::PreferencesService::~PreferencesService() Line 86
[External Code]
berry::Object::UnRegister(bool del) Line 115
berry::SmartPointer<berry::IPreferencesService>::UnRegister() Line 316
berry::SmartPointer<berry::IPreferencesService>::~SmartPointer() Line 126
[External Code]
QmitkExtApplicationPlugin::~QmitkExtApplicationPlugin() Line 43
[External Code]
Qt5Cored.dll!QLibraryPrivate::unload(QLibraryPrivate::UnloadFlag flag) Line 548
Qt5Cored.dll!QLibraryStore::cleanup() Line 399
Qt5Cored.dll!qlibraryCleanup() Line 419

In berryXMLPreferencesStorage.cpp:99, opening of the preference file crashes:

f.open (this->m_File.path().c_str());

Where path is "C:/Users/Stefan/AppData/Local/DKFZ/MITK Workbench_2871227531/data/5\\prefs.xml"

I guess the "\\" might be a potential candidate, as the file does exist.

Okay, it's not. This code is called several times during application and it works every time. Even on application shutdown it works the first time and then fails (see stack trace above).

Next step is to see if it fails on Linux at this function of the standard library too:

liborg_blueberry_core_runtime.dll!std::basic_filebuf<char,std::char_traits<char> >::_Initcvt(const std::codecvt<char,char,int> * _Newpcvt)

Debug output at application shutdown:

First-chance exception at 0x000007FEFDC2940D (KernelBase.dll) in MitkWorkbench.exe: 0x0000000D: The data is invalid.
The thread 0x12b0 has exited with code 0 (0x0).
The thread 0xe84 has exited with code 0 (0x0).
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: Poco::SystemException at memory location 0x00000000050AE640.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: ctkPluginException at memory location 0x00000000050AF140.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: Poco::SystemException at memory location 0x00000000050AECC0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: ctkPluginException at memory location 0x00000000050AF140.
The thread 0x13e0 has exited with code 0 (0x0).
The thread 0x1228 has exited with code 0 (0x0).
The thread 0xfa0 has exited with code 0 (0x0).
The thread 0xee8 has exited with code 0 (0x0).
The thread 0xf94 has exited with code 0 (0x0).
The thread 0x838 has exited with code 0 (0x0).
The thread 0x1270 has exited with code 0 (0x0).
The thread 0x10b8 has exited with code 0 (0x0).
The thread 0x1140 has exited with code 0 (0x0).
The thread 0x1208 has exited with code 0 (0x0).
The thread 0xe18 has exited with code 0 (0x0).
The thread 0x1124 has exited with code 0 (0x0).
The thread 0x9a8 has exited with code 0 (0x0).
The thread 0x9dc has exited with code 0 (0x0).
The thread 0x1170 has exited with code 0 (0x0).
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE120.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DF038.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DEF38.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE030.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE050.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE050.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE050.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE050.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE050.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DE360.
LEAK: 5 CachedResource
LEAK: 48 WebCoreNode
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDE90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDE90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDE90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDE90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD90.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDD50.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x000007FEFDC2940D in MitkWorkbench.exe: Microsoft C++ exception: std::logic_error at memory location 0x00000000001DDDB0.
First-chance exception at 0x0000000000000000 in MitkWorkbench.exe: 0xC0000005: Access violation executing location 0x0000000000000000.
Unhandled exception at 0x0000000000000000 in MitkWorkbench.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

User kislinsk has pushed new remote branch:

bug-18575-CrashOnApplicationShutdown

User kislinsk has pushed new remote branch:

bug-18575-IntegrationBranch

[d0d8b9]: Merge branch 'bug-18575-IntegrationBranch'

Merged commits:

2015-01-16 14:30:37 Stefan Kislinskiy [62c77e]
Commented bug fix.


2015-01-14 17:42:29 Stefan Kislinskiy [ea4e94]
Fixed crash in MSVC 2013 due to locale vtbl deletion through DLL unloading.

User kislinsk has pushed new remote branch:

bug-18575-Fix

[95599e]: Merge branch 'bug-18575-Fix'

Merged commits:

2015-01-21 12:57:29 Stefan Kislinskiy [20cc17]
Only switch locales for MSVC.

Still happens on MSVC 2013 Update 3 with MITK Superbuild and QT 5.4.

#ifdef in line 88 is parsed and locale is switched to std::locale("") but debug error from xstring.h (string iterators incompatible) still is thrown.

Call Stack:

PocoXMLd.dll!std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > >::_Compat(const std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > > & _Right) Line 250 C++

	PocoXMLd.dll!std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > >::operator==(const std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > > & _Right)  Line 215	C++
	PocoXMLd.dll!std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > >::operator!=(const std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > > & _Right)  Line 220 + 0xf bytes	C++
	PocoXMLd.dll!Poco::XML::NamePool::hash(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & qname, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & namespaceURI, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & localName)  Line 120 + 0xf bytes	C++
	PocoXMLd.dll!Poco::XML::NamePool::insert(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & qname, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & namespaceURI, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & localName)  Line 95 + 0x25 bytes	C++
	PocoXMLd.dll!Poco::XML::Element::Element(Poco::XML::Document * pOwnerDocument, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & namespaceURI, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & localName, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & qname)  Line 34 + 0x76 bytes	C++
	PocoXMLd.dll!Poco::XML::Document::createElement(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & tagName)  Line 137 + 0x3e bytes	C++
	liborg_blueberry_core_runtime.dll!berry::XMLPreferencesStorage::ToDOMTree(berry::Preferences * prefNode, Poco::XML::Node * parentDOMNode)  Line 168 + 0x36 bytes	C++
	liborg_blueberry_core_runtime.dll!berry::XMLPreferencesStorage::Flush(berry::IPreferences * __formal)  Line 96	C++
	liborg_blueberry_core_runtime.dll!berry::Preferences::Flush()  Line 146	C++
	liborg_blueberry_core_runtime.dll!berry::PreferencesService::ShutDown()  Line 175 + 0x82 bytes	C++
	liborg_blueberry_core_runtime.dll!berry::PreferencesService::~PreferencesService()  Line 86 + 0xa bytes	C++
	liborg_blueberry_core_runtime.dll!berry::PreferencesService::`vector deleting destructor'()  + 0x83 bytes	C++
	liborg_blueberry_osgi.dll!berry::Object::UnRegister(bool del)  Line 115 + 0x31 bytes	C++
	liborg_blueberry_ui.dll!berry::SmartPointer<berry::IPreferencesService>::UnRegister()  Line 316	C++
	liborg_blueberry_ui.dll!berry::SmartPointer<berry::IPreferencesService>::~SmartPointer<berry::IPreferencesService>()  Line 126	C++
	liborg_blueberry_ui.dll!berry::AbstractUICTKPlugin::~AbstractUICTKPlugin()  + 0x38 bytes	C++
	liborg_blueberry_ui.dll!berry::WorkbenchPlugin::~WorkbenchPlugin()  Line 58 + 0x14 bytes	C++
	liborg_blueberry_ui.dll!berry::WorkbenchPlugin::`scalar deleting destructor'()  + 0x2c bytes	C++
	Qt5Cored.dll!QLibraryPrivate::unload(QLibraryPrivate::UnloadFlag flag)  Line 548 + 0x40 bytes	C++
	Qt5Cored.dll!QLibraryStore::cleanup()  Line 399	C++
	Qt5Cored.dll!qlibraryCleanup()  Line 419	C++
	Qt5Cored.dll!`anonymous namespace'::qlibraryCleanup_dtor_class_::~qlibraryCleanup_dtor_class_()  Line 420 + 0xe bytes	C++
	Qt5Cored.dll!`anonymous namespace'::`dynamic atexit destructor for 'qlibraryCleanup_dtor_instance_''()  + 0x10 bytes	C++
	Qt5Cored.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 416	C
	Qt5Cored.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 522 + 0x13 bytes	C
	Qt5Cored.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved)  Line 473	C
	ntdll.dll!LdrShutdownProcess()  + 0x1d1 bytes	
	ntdll.dll!RtlExitUserProcess()  + 0x90 bytes	
	msvcr120d.dll!__crtExitProcess()  + 0x1b bytes	
	msvcr120d.dll!_unlockexit()  + 0x30f bytes	
	msvcr120d.dll!exit()  + 0x16 bytes	
	image_explorer.exe!__tmainCRTStartup()  Line 662	C
	image_explorer.exe!mainCRTStartup()  Line 466	C
	kernel32.dll!BaseThreadInitThunk()  + 0xd bytes	
	ntdll.dll!RtlUserThreadStart()  + 0x21 bytes

((changing status to unconfirmed on MSVC 2013 Update 3 )) as reported recently

On which system was the fix verified?
Please tell me if I can assist anyhow.
;) Ingmar

This is a slightly different issue which is not directly related to the fix above, but I guess it fits into this bug description anyways. :)

I already debugged the issue you just reported last week. It turned out, that it probably has something to do with library unloading and/or the undefined order of cleaning up global variables.

The very same code path works multiple times during startup and the first few times on shutdown sometimes. Poco uses an internal global const std::string called EMPTY_STRING which is used to be able to return a reference to an empty string from any function. At some point during application shutdown, this container (string) is obviously not valid anymore (the container reference of the iterator in question is 0). This is a special case when checking whether iterators are compatible (meaning that iterators have the very same container as reference), which is also true for two dangling iterators even both references are the same (0).

I guess this one is quite tricky to fix. Any ideas / help is appreciated. ;)

BTW this issue does not occur in Release mode as the checking of iterators is only done for a higher value of _ITERATOR_DEBUG_LEVEL. If you quickly need a workaround, lowering this value in debug mode could be a temporary "solution". Note that I put solution in quotation marks, I know that this is not a true solution. :)

A first attempt for a true solution could be to check if Poco is really in an unloading/unloaded state when this bug happens and to find out then how we could defer unloading.

;) absolutely agree!
And yes, _ITERATOR_DEBUG_LEVEL would be a temp solution... but it's not that urgent.

I postponed it so long on my side as I am currently working on IO. Will probably come back to this next week but by low level skills are not that good, I guess!

Have a nice weekend,
Ingmar

With the latest changes of BlueBerry, both(!) issues descriped in this bug do not occur anymore. However, the integration of the BlueBerry changes is not yet complete which is why I cannot recommend to update to the latest master right now.

Great and good to know. Is there a rough schedule when the feature will be finished to integrate the bugfix into the master? Or is there a way to isolate the bugfix only?
Best, Ingmar

Next week when Sascha is back it will be finished.

I said I wouldn't recommend to use the current master mainly because the Workbench didn't run in Release mode and the Packaging doesn't work currently. Meanwhile, without changing anything, both debug and release mode works for me. But (there's always one, isn't it? :]) Marco still have the string iterator issue in his VM. So... maybe some race condition is going on here and it is not really fixed. sigh

Would be great if you could run an off-side debug-and-release build of the current master (maybe over night) and report what's going on on your side during startup/shutdown of the Workbench both in debug and relealse mode?

Sure! So I have updated to the current master (96ce992e5d1e51dba0aabe1541af9a7a145d9eba) and configured and generated cmake (not a complete superbuild rebuild yet).

There is an additional output message in the console:
1.19 blueberry.ui..wrkbncPlg: LOG: org.mitk.gui.qt.extapplication: Invalid intro binding. introId and productId must be defined

Release: start-up, loading stl and nrrd files, closing works fine, no crash.

Debug: start-up, loading stl and nrrd files, closing works fine. No crash during shutdown.
Additional message in console: 6.92 blueberry.core.Commands.commandtracing: HANDLERS >>> Command('org.blueberry.ui.views.showView') has changed to 'berry::ShowViewHandler' as its handler

;) Looks good!

Thank you for testing. That's exactly what I see on my machine as well.

Removed 2015.05.02 target milestone as this bug was resolved before 2015.05.