Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.1.0, 6.1.1
-
None
-
-
fa7f4c5efd91c852341dd2e56396ee3f5fedd33a dbb2092d8d27eb3d5bb8a0f770b00fc93bb3553e
Description
I get a crash on MSVC with a program that loads Qt libraries dynamically when loading a shared library plugin (created via Boost.DLL). The crash comes at program end (very late), after most threads have already ended. It seems to come from somewhere inside Qt6Cored.dll, and have something to do with QMetaTypeFunctionRegistry. I do indeed use QMetaType with Q_DECLARE_METATYPE and qRegisterMetaType to register a number of custom types, like std::string and a few std::shared_ptr, so maybe this is related
The compiler I use to build Qt is MSVC 2019, v19.10.1. The compiler I use for my other libraries and projects (on top of Qt) is ClangCl 12.0.0 from LLVM upstream, in combination with MSVC 2019, v19.10.1.
The crash stops in the following line:
_Getimpl()->_Delete_this(!_Local());
Here is the stack trace as far as I could get it from Visual Studio:
Qt6Cored.dll!std::_Func_class<bool,void *,void *>::_Tidy() Line 1046 C++ Qt6Cored.dll!std::_Func_class<bool,void *,void *>::~_Func_class<bool,void *,void *>() Line 973 C++ Qt6Cored.dll!std::function<bool __cdecl(void *,void *)>::~function<bool __cdecl(void *,void *)>() C++ Qt6Cored.dll!QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>::~Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>() C++ Qt6Cored.dll!QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>::`scalar deleting destructor'(unsigned int) C++ Qt6Cored.dll!QHashPrivate::Span<QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>>::freeData() Line 324 C++ Qt6Cored.dll!QHashPrivate::Span<QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>>::~Span<QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>>() Line 316 C++ [External Code] Qt6Cored.dll!QHashPrivate::Data<QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>>::~Data<QHashPrivate::Node<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>>() Line 690 C++ [External Code] Qt6Cored.dll!QHash<std::pair<int,int>,std::function<bool __cdecl(void *,void *)>>::clear() Line 859 C++ > Qt6Cored.dll!QMetaTypeFunctionRegistry<std::function<bool __cdecl(void *,void *)>,std::pair<int,int>>::~QMetaTypeFunctionRegistry<std::function<bool __cdecl(void *,void *)>,std::pair<int,int>>() Line 1535 C++ [External Code]
Attachments
For Gerrit Dashboard: QTBUG-94831 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
536467,5 | QMetaTypeFunctionRegistry: optimize unregister() | dev | qt/qtbase | Status: NEW | +2 | 0 |
362724,1 | QMetaType: leak the std::functions on exit | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |
362728,5 | QMetaType: add a more trivial converter/view storage than std::function | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
362730,3 | QMetaType: add more trivial registerConverterFunction / MutableView | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
362856,5 | QMetaType: auto-unregister converters and mutable views again | dev | qt/qtbase | Status: MERGED | +2 | 0 |
363132,2 | QMetaType: auto-unregister converters and mutable views again | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |