Repository: bitcoin
Issue: Trying to run bitcoin qt on Windows and getting an AV
Labels: Windows,Tests

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current behaviour

********* Start testing of AppTests *********
Config: Using QtTest library 5.15.10, Qt 5.15.10 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2022), windows 11
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "C:\\Users\\danilog\\AppData\\Local\\Temp\\test_common_Bitcoin Core\\13cec4b43759d5d6b469fa4cd0b3ea34c2e956e50f2acca5a4f7af1934ed2746\\regtest\\guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() Running initialization in thread
QDEBUG : AppTests::appTests() initializeResult : Initialization result:  true
QINFO  : AppTests::appTests() Platform customization: "windows"
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 5 (MENU). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 14 (TRACKBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 14 (TRACKBAR). (The handle is invalid.)
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QWARN  : AppTests::appTests() This plugin does not support raise()
QWARN  : AppTests::appTests() This plugin does not support raise()
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 4 (LISTVIEW). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 4 (LISTVIEW). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 8 (SCROLLBAR). (The handle is invalid.)
QWARN  : AppTests::appTests() This plugin does not support grabbing the keyboard
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 12 (TOOLBAR). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 17 (STATUS). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QSYSTEM: AppTests::appTests() OpenThemeData() failed for theme 10 (TAB). (The handle is invalid.)
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()
QDEBUG : AppTests::appTests() requestShutdown : Requesting shutdown
QDEBUG : AppTests::appTests() Running Shutdown in thread
QDEBUG : AppTests::appTests() Shutdown finished
PASS   : AppTests::appTests()
PASS   : AppTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 2867ms
********* Finished testing of AppTests *********
********* Start testing of OptionTests *********
Config: Using QtTest library 5.15.10, Qt 5.15.10 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2022), windows 11
PASS   : OptionTests::initTestCase()
PASS   : OptionTests::migrateSettings()
PASS   : OptionTests::integerGetArgBug()
PASS   : OptionTests::parametersInteraction()
PASS   : OptionTests::extractFilter()
PASS   : OptionTests::cleanupTestCase()
Totals: 6 passed, 0 failed, 0 skipped, 0 blacklisted, 54ms
********* Finished testing of OptionTests *********
********* Start testing of URITests *********
Config: Using QtTest library 5.15.10, Qt 5.15.10 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2022), windows 11
PASS   : URITests::initTestCase()
PASS   : URITests::uriTests()
PASS   : URITests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1ms
********* Finished testing of URITests *********
********* Start testing of RPCNestedTests *********
Config: Using QtTest library 5.15.10, Qt 5.15.10 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2022), windows 11
PASS   : RPCNestedTests::initTestCase()
PASS   : RPCNestedTests::rpcNestedTests()
PASS   : RPCNestedTests::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 227ms
********* Finished testing of RPCNestedTests *********
********* Start testing of WalletTests *********
Config: Using QtTest library 5.15.10, Qt 5.15.10 (x86_64-little_endian-llp64 shared (dynamic) debug build; by MSVC 2022), windows 11
PASS   : WalletTests::initTestCase()
QDEBUG : WalletTests::walletTests() NotifyUnload
QWARN  : WalletTests::walletTests() This plugin does not support propagateSizeHints()

### Expected behaviour

to not crash

### Steps to reproduce

Follow the MSVC compilation process on Windows 11 23H2

### Relevant log output

00 Qt5Widgetsd!qt_getWindowsSystemMenu
01 Qt5Widgetsd!QMessageBox::showEvent
02 Qt5Widgetsd!QWidget::event
03 Qt5Widgetsd!QMessageBox::event
04 Qt5Widgetsd!QApplicationPrivate::notify_helper
05 Qt5Widgetsd!QApplication::notify
06 Qt5Cored!QCoreApplication::notifyInternal2
07 Qt5Cored!QCoreApplication::sendEvent
08 Qt5Widgetsd!QWidgetPrivate::show_helper
09 Qt5Widgetsd!QWidgetPrivate::setVisible
0a Qt5Widgetsd!QWidget::setVisible
0b Qt5Widgetsd!QDialog::setVisible
0c Qt5Widgetsd!QWidget::show
0d Qt5Widgetsd!QDialog::exec
0e test_bitcoin_qt!SendConfirmationDialog::exec
0f test_bitcoin_qt!SendCoinsDialog::sendButtonClicked
10 test_bitcoin_qt!SendCoinsDialog::qt_static_metacall
11 Qt5Cored!QMetaMethod::invoke
12 Qt5Cored!QMetaObject::invokeMethod
13 Qt5Cored!QMetaObject::invokeMethod
14 test_bitcoin_qt!`anonymous namespace'::SendCoins
15 test_bitcoin_qt!`anonymous namespace'::TestGUI
16 test_bitcoin_qt!`anonymous namespace'::TestGUI
17 test_bitcoin_qt!WalletTests::walletTests
18 test_bitcoin_qt!WalletTests::qt_static_metacall
19 Qt5Cored!QMetaMethod::invoke
1a Qt5Cored!QMetaMethod::invoke
1b Qt5Testd!QTest::TestMethods::invokeTestOnData
1c Qt5Testd!QTest::TestMethods::invokeTest
1d Qt5Testd!QTest::TestMethods::invokeTests
1e Qt5Testd!QTest::qRun
1f Qt5Testd!QTest::qExec
20 test_bitcoin_qt!main
21 test_bitcoin_qt!invoke_main
22 test_bitcoin_qt!__scrt_common_main_seh
23 test_bitcoin_qt!__scrt_common_main
24 test_bitcoin_qt!mainCRTStartup
25 KERNEL32!BaseThreadInitThunk
26 ntdll!RtlUserThreadStart

0:000> r
rax=0000000000000000 rbx=0000000000000000 rcx=0000015726c5f400
rdx=0000000000000000 rsi=00000042021f8eb0 rdi=00000042021f5b50
rip=00007ffc5a7d0e81 rsp=00000042021f5a70 rbp=0000000000000000
 r8=000001572cdaf901  r9=0000000000000001 r10=0000015724fe0000
r11=00000042021f54e0 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
iopl=0         nv up ei pl nz na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010206
Qt5Widgetsd!qt_getWindowsSystemMenu+0x31:
00007ffc`5a7d0e81 488b00          mov     rax,qword ptr [rax] ds:00000000`00000000=????????????????

### How did you obtain Bitcoin Core

Compiled from source

### What version of Bitcoin Core are you using?

latest master

### Operating system and version

Windows 11 23H2

### Machine specifications

_No response_