$ cat foo.cpp
#include <iostream>
int main() {
std::cout.fill();
return 0;
}
$ x86_64-w64-mingw32-g++ -O3 -static foo.cpp && wine ./a.exe
$ x86_64-w64-mingw32-g++ -O3 -flto -static foo.cpp && wine ./a.exe
wine: Unhandled page fault on read access to 0x00000000 at address (nil) (thread 0032), starting debugger...
fixme:dbghelp:elf_search_auxv can't find symbol in module
fixme:dbghelp:elf_search_auxv can't find symbol in module
fixme:dbghelp:elf_search_auxv can't find symbol in module
fixme:dbghelp:elf_search_auxv can't find symbol in module
fixme:dbghelp:elf_search_auxv can't find symbol in module
Unhandled exception: page fault on read access to 0x00000000 in 64-bit code (0x0000000000000000).
fixme:dbghelp:elf_search_auxv can't find symbol in module
Register dump:
rip:0000000000000000 rsp:000000000033fb68 rbp:0000000000d81a70 eflags:00010206 ( R- -- I - -P- )
rax:0000000000000020 rbx:00000000004a6ba0 rcx:00000000004a5160 rdx:0000000000000020
rsi:0000000000000043 rdi:0000000000014f40 r8:0000000000000000 r9:0000000000000006 r10:00000000ffffffff
r11:0000000000000000 r12:0000000000000001 r13:0000000000000008 r14:0000000000000000 r15:0000000000000000
Stack dump:
0x000000000033fb68: 00000000004a3b48 0000000000000000
0x000000000033fb78: 0000000000000000 0000000000000043
0x000000000033fb88: 0000000000000001 0000000000000001
0x000000000033fb98: 00000000004013f8 0000000000000000
0x000000000033fba8: 0000000000000000 0000000020b235af
0x000000000033fbb8: 01d35424c1be01a4 0000000000000000
0x000000000033fbc8: 0000000000000000 0000000000000000
0x000000000033fbd8: 0000000000000000 0000000000000000
0x000000000033fbe8: 0000000000000000 0000000000000000
0x000000000033fbf8: 0000000000000000 0000000000000000
0x000000000033fc08: 0000000000000000 0000000000000000
0x000000000033fc18: 0000000000000000 0000000000000000
Backtrace:
=>0 0x0000000000000000 (0x0000000000d81a70)
0x0000000000000000: -- no code accessible --
Modules:
Module Address Debug info Name (20 modules)
PE 400000- d72000 Deferred a
ELF 7b400000- 7b812000 Deferred kernel32<elf>
\-PE 7b420000- 7b812000 \ kernel32
ELF 7bc00000- 7bd1b000 Deferred ntdll<elf>
\-PE 7bc20000- 7bd1b000 \ ntdll
ELF 7c000000- 7c004000 Deferred <wine-loader>
ELF 7f348070e000- 7f348093a000 Deferred libtinfo.so.6
ELF 7f348093a000- 7f3480b72000 Deferred libncursesw.so.6
ELF 7f3480c72000- 7f3480f53000 Deferred msvcrt<elf>
\-PE 7f3480c90000- 7f3480f53000 \ msvcrt
ELF 7f3480f53000- 7f3481165000 Deferred libnss_files.so.2
ELF 7f3481165000- 7f3481371000 Deferred libnss_nis.so.2
ELF 7f3481371000- 7f3481589000 Deferred libnsl.so.1
ELF 7f3481589000- 7f3481791000 Deferred libnss_compat.so.2
ELF 7f3481ec7000- 7f34820de000 Deferred libgcc_s.so.1
ELF 7f34820de000- 7f348242a000 Deferred libm.so.6
ELF 7f348242c000- 7f3482630000 Deferred libdl.so.2
ELF 7f3482674000- 7f3482a2b000 Deferred libc.so.6
ELF 7f3482a2b000- 7f3482c49000 Deferred libpthread.so.0
ELF 7f3482ff0000- 7f3483217000 Deferred ld-linux-x86-64.so.2
Threads:
process tid prio (all id:s are in hex)
0000000e services.exe
00000022 0
0000001d 0
00000013 0
00000010 0
0000000f 0
00000011 winedevice.exe
0000001c 0
00000017 0
00000016 0
00000012 0
0000001a plugplay.exe
0000001f 0
0000001e 0
0000001b 0
00000020 winedevice.exe
0000002b 0
00000024 0
00000023 0
00000021 0
00000031 (D) Z:\home\tavianator\code\maluuba\NativeNlp\out-windows-x86_64\a.exe
00000032 0 <==
00000035 explorer.exe
00000039 0
00000038 0
00000037 0
00000036 0
System information:
Wine build: wine-2.19
Platform: x86_64
Version: Windows XP
Host system: Linux
Host version: 4.13.8-1-ARCH
Crashes similarly on native Windows too, so it's not a Wine bug.
Tried on Win10 with gcc version 7.1.0 (x86_64-posix-seh-rev2, Built by MinGW-W64 project), compile without
-staticor-static-libstdc++doesn't crash.Last edit: Zufu Liu 2017-11-03