Consider a C++ program:
#include <sqlite3.h>
int main(int argc, char**argv) {
return 0;
}
void not_called() {
sqlite3_initialize();
}
Compile, link, and run it:
$ x86_64-w64-mingw32-g++ -c -g -o augh.o augh.cpp
$ x86_64-w64-mingw32-g++ -static -fstack-protector -g -o augh.exe augh.o -lsqlite3
$ wine augh.exe
On Fedora 36, with
and also previously with wine-7.10-2.fc36.x86_64, I consistently get this output:
[juckelman@midas augh]$ ./augh.exe
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.12 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
0080:err:x11drv:X11DRV_ChangeDisplaySettingsEx Failed to write L"\\\\.\\DISPLAY1" display settings to registry.
0080:err:system:NtUserChangeDisplaySettings Changing L"\\\\.\\DISPLAY1" display settings returned -3.
0080:err:explorer:initialize_display_settings Failed to initialize registry display settings for L"\\\\.\\DISPLAY1".
0114:err:sync:RtlpWaitForCriticalSection section 00000002DE99D010 "?" wait timed out in thread 0114, blocked by 0000, retrying (60 sec)
The final line repeats endlessly and the program never exits.
If I comment out sqlite3_initialize()
(which is in a function that's never called!), I get this output:
[juckelman@midas augh]$ ./augh.exe
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.12 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
MESA-INTEL: warning: Haswell Vulkan support is incomplete
0080:err:x11drv:X11DRV_ChangeDisplaySettingsEx Failed to write L"\\\\.\\DISPLAY1" display settings to registry.
0080:err:system:NtUserChangeDisplaySettings Changing L"\\\\.\\DISPLAY1" display settings returned -3.
0080:err:explorer:initialize_display_settings Failed to initialize registry display settings for L"\\\\.\\DISPLAY1".
[juckelman@midas augh]$
The program exits successfully every time.
On Fedora 35 with
the program exits successfully either way, regardless of the presence of sqlite3_initialize()
.
On Fedora 36, if I dynamically link with sqlite3 instead, the program also exits successfully.
What is going on here?
This no longer happens with Wine 7.22. The solution is to upgrade.