JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.78k stars 5.49k forks source link

Julia crashes due to corrupt export table in MinGW-w64 libstdc++ #18123

Closed Keno closed 8 years ago

Keno commented 8 years ago
    JULIA usr/lib/julia/inference.ji
fixme:winsock:WS_EnterSingleProtocolW unknown Protocol <0x00000000>
fixme:winsock:WS_EnterSingleProtocolW unknown Protocol <0x00000000>
fixme:ntdll:NtQueryVolumeInformationFile 0xd0: volume info not supported
wine: Unhandled page fault on read access to 0x91020010 at address 0x6f64f0d3 (thread 0086), starting debugger...
err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded.
err:winediag:nulldrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Unhandled exception: page fault on read access to 0x91020010 in 64-bit code (0x000000006f64f0d3).
Register dump:
 rip:000000006f64f0d3 rsp:0000000000c5bd80 rbp:0000000000c5be00 eflags:00010202 (  R- --  I   - - - )
 rax:0000000000d44b30 rbx:0000000091020000 rcx:0000000000c5be80 rdx:0000000000d30020
 rsi:0000000000c5be80 rdi:0000000002a79a60  r8:0000000000000002  r9:0000000000c5c080 r10:00000000000001ff
 r11:00007f993b804067 r12:0000000002aa4070 r13:00007f993b7e0490 r14:0000000000000010 r15:00007f993b7bdf60
Stack dump:
0x0000000000c5bd80:  00007f993b7b4150 ffffffffffffffff
0x0000000000c5bd90:  0000000000000001 0000000000000001
0x0000000000c5bda0:  0000000000c5be30 000000006f58472f
0x0000000000c5bdb0:  654b74666f53796f 49006472616f6279
0x0000000000c5bdc0:  6e496d756e456d6d 65746e6f43747570
0x0000000000c5bdd0:  00007f993b7a8020 00007f993b7a13f0
0x0000000000c5bde0:  00007f993b7a0010 ffffffffffffffff
0x0000000000c5bdf0:  6e496d6d49005765 00007f993b804070
0x0000000000c5be00:  0000000000c5c080 0000000000c5bf00
0x0000000000c5be10:  00007f993b7a0250 0000000000000001
0x0000000000c5be20:  0000000000c5c010 0000000000150880
0x0000000000c5be30:  0000000000c5bec0 000000006f585576
Backtrace:
=>0 0x000000006f64f0d3 in libjulia (+0xcf0d3) (0x0000000000c5be00)
  1 0x000000006f67dc24 in libjulia (+0xfdc23) (0x0000000000c5c100)
  2 0x000000006f678d66 in libjulia (+0xf8d65) (0x0000000000c5c1a0)
  3 0x000000006f65d40f in libjulia (+0xdd40e) (0x0000000000c5c220)
  4 0x000000006f67eac3 in libjulia (+0xfeac2) (0x0000000000c5c3b0)
  5 0x000000006f656a7f in libjulia (+0xd6a7e) (0x0000000000c5c5d0)
  6 0x000000006f67e282 in libjulia (+0xfe281) (0x0000000000c5c6d0)
  7 0x000000006f67eedd in libjulia (+0xfeedc) (0x0000000000c5c810)
  8 0x000000006f660e75 in libjulia (+0xe0e74) (0x0000000000c5c9e0)
  9 0x000000006f67ed95 in libjulia (+0xfed94) (0x0000000000c5ca90)
  10 0x000000006f657eda in libjulia (+0xd7ed9) (0x0000000000c5cc00)
  11 0x000000006f65adce in libjulia (+0xdadcd) (0x0000000000c5cc90)
  12 0x000000006f69dc7a in libjulia (+0x11dc79) (0x0000000000c5d7f0)
  13 0x000000006f595628 in libjulia (+0x15627) (0x0000000000c5d980)
  14 0x000000006f594a4e in libjulia (+0x14a4d) (0x0000000000c5da40)
  15 0x000000006f5aa695 in libjulia (+0x2a694) (0x0000000000c5db30)
  16 0x000000006f5a98a1 in libjulia (+0x298a0) (0x0000000000c5dba0)
  17 0x000000006f5aa67d in libjulia (+0x2a67c) (0x0000000000c5e160)
  18 0x000000006f5a98a1 in libjulia (+0x298a0) (0x0000000000c5e1d0)
  19 0x000000006f5aa67d in libjulia (+0x2a67c) (0x0000000000c5e790)
  20 0x000000006f5a98a1 in libjulia (+0x298a0) (0x0000000000c5e800)
  21 0x000000006f5a984b in libjulia (+0x2984a) (0x0000000000c5ed80)
  22 0x000000006f5aaa90 in libjulia (+0x2aa8f) (0x0000000000c5f300)
  23 0x000000006f5c537e in libjulia (+0x4537d) (0x0000000000c5f4d0)
  24 0x000000006f59e4c4 in libjulia (+0x1e4c3) (0x0000000000c5f5a0)
  25 0x000000006f5c6984 in libjulia (+0x46983) (0x0000000000c5f800)
  26 0x000000006f5b40a4 in libjulia (+0x340a3) (0x0000000000c5f8c0)
  27 0x000000006f5b452d in libjulia (+0x3452c) (0x0000000000c5fa50)
err:dbghelp_stabs:stabs_parse Unknown stab type 0x0a
  28 0x0000000000402428 in julia (+0x2427) (0x0000000000c5fbf0)
  29 0x0000000000401482 in julia (+0x1481) (0x0000000000c5fd10)
  30 0x0000000000401181 in julia (+0x1180) (0x0000000000c5fd50)
  31 0x000000007b47b837 start_process+0x96(peb=0x7fffff7ef000) [/root/wine64-build/dlls/kernel32/../../../wine/dlls/kernel32/process.c:1077] in kernel32 (0x0000000000c5fe40)
  32 0x000000007bc990c3 call_thread_func+0xd2(entry=0x7b47b7a0, arg=0x7fffff7ef000, frame=<is not available>) [/root/wine64-build/dlls/ntdll/../../../wine/dlls/ntdll/signal_x86_64.c:3856] in ntdll (0x00007fff8974cbb0)
  33 0x000000007bc92002 call_thread_entry_point+0x29() in ntdll (0x00007fff8974cbb0)
  34 0x000000007bc5ea76 start_process+0x15(kernel_start=<is not available>) [/root/wine64-build/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:3047] in ntdll (0x00007fff8974cbb0)
  35 0x00007f9b41d70f83 wine_call_on_stack+0x12() in libwine.so.1 (0x00007fff8974cbb0)
  36 0x00007f9b41d710e9 wine_switch_to_stack+0x8(func=<is not available>, arg=<is not available>, stack=<is not available>) [/root/wine64-build/libs/wine/../../../wine/libs/wine/port.c:77] in libwine.so.1 (0x00007fff8974cce0)
  37 0x000000007bc6517c LdrInitializeThunk+0x2eb(kernel_start=0x7b47b7a0, unknown2=<is not available>, unknown3=<is not available>, unknown4=<is not available>) [/root/wine64-build/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:3103] in ntdll (0x00007fff8974cce0)
  38 0x000000007b482bc3 __wine_kernel_init+0xb02() [/root/wine64-build/dlls/kernel32/../../../wine/dlls/kernel32/process.c:1302] in kernel32 (0x00007fff8974df60)
  39 0x000000007bc66268 __wine_process_init+0x177() [/root/wine64-build/dlls/ntdll/../../../wine/dlls/ntdll/loader.c:3312] in ntdll (0x00007fff8974dfa0)
  40 0x00007f9b41d6f7b2 wine_init+0x2c1(argc=0x8, argv=0x7fff8974e5a8, error="", error_size=<is not available>) [/root/wine64-build/libs/wine/../../../wine/libs/wine/loader.c:956] in libwine.so.1 (0x00007fff8974e0a0)
  41 0x000000007c000b42 main+0x81(argc=0x8, argv=0x7fff8974e5a8) [/root/wine64-build/loader/../../wine/loader/main.c:254] in <wine-loader> (0x00007fff8974e5a8)
  42 0x00007f9b41793830 __libc_start_main+0xef() in libc.so.6 (0x000000007c000d10)
  43 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  44 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  45 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  46 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  47 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  48 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  49 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  50 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  51 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  52 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  53 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  54 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  55 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  56 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  57 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  58 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  59 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  60 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  61 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  62 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  63 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  64 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  65 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  66 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  67 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  68 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  69 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  70 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  71 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  72 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  73 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  74 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  75 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  76 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  77 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  78 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  79 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  80 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  81 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  82 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  83 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  84 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  85 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  86 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  87 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  88 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  89 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  90 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  91 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  92 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  93 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  94 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  95 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  96 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  97 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  98 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  99 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  100 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  101 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  102 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  103 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  104 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  105 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  106 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  107 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  108 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  109 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  110 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  111 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  112 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  113 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  114 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  115 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  116 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  117 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  118 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  119 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  120 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  121 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  122 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  123 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  124 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  125 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  126 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  127 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  128 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  129 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  130 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  131 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  132 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  133 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  134 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  135 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  136 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  137 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  138 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  139 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  140 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  141 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  142 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  143 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  144 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  145 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  146 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  147 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  148 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  149 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  150 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  151 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  152 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  153 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  154 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  155 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  156 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  157 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  158 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  159 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  160 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  161 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  162 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  163 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  164 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  165 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  166 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  167 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  168 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  169 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  170 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  171 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  172 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  173 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  174 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  175 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  176 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  177 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  178 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  179 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  180 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  181 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  182 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  183 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  184 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  185 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  186 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  187 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  188 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  189 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  190 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  191 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  192 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  193 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  194 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  195 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  196 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  197 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  198 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  199 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
  200 0x000000007c000c39 _start+0x28() in <wine-loader> (0x0000000000000000)
0x000000006f64f0d3: movq    0x0000000000000010(%rbx),%r12
Modules:
Module  Address                 Debug info  Name (64 modules)
PE            400000-          45e000   Dwarf           julia
PE            c60000-         18a7000   Deferred        libstdc++-6
PE          61440000-        61523000   Deferred        libgcc_s_seh-1
PE          66640000-        67b43000   Deferred        llvm-3.7
PE          68ac0000-        68adf000   Deferred        libssp-0
PE          6f580000-        70b8f000   Dwarf           libjulia
ELF         7b400000-        7b6cb000   Dwarf           kernel32<elf>
  \-PE          7b420000-        7b6cb000   \               kernel32
ELF         7bc00000-        7bd1c000   Dwarf           ntdll<elf>
  \-PE          7bc20000-        7bd1c000   \               ntdll
ELF         7c000000-        7c004000   Dwarf           <wine-loader>
ELF     7f9b3c7f9000-    7f9b3ca21000   Deferred        imm32<elf>
  \-PE      7f9b3c800000-    7f9b3ca21000   \               imm32
ELF     7f9b3ca21000-    7f9b3cc4a000   Deferred        libexpat.so.1
ELF     7f9b3cc4a000-    7f9b3ce8d000   Deferred        libfontconfig.so.1
ELF     7f9b3ce8d000-    7f9b3d0b2000   Deferred        libpng12.so.0
ELF     7f9b3d0b2000-    7f9b3d35c000   Deferred        libfreetype.so.6
ELF     7f9b3d35c000-    7f9b3d585000   Deferred        libtinfo.so.5
ELF     7f9b3d585000-    7f9b3d7a7000   Deferred        libncurses.so.5
ELF     7f9b3d7a7000-    7f9b3da39000   Deferred        shlwapi<elf>
  \-PE      7f9b3d7c0000-    7f9b3da39000   \               shlwapi
ELF     7f9b3da39000-    7f9b3de75000   Deferred        shell32<elf>
  \-PE      7f9b3da50000-    7f9b3de75000   \               shell32
ELF     7f9b3de75000-    7f9b3e0b5000   Deferred        ws2_32<elf>
  \-PE      7f9b3de80000-    7f9b3e0b5000   \               ws2_32
ELF     7f9b3e0b5000-    7f9b3e2dd000   Deferred        msacm32<elf>
  \-PE      7f9b3e0c0000-    7f9b3e2dd000   \               msacm32
ELF     7f9b3e2dd000-    7f9b3e577000   Deferred        rpcrt4<elf>
  \-PE      7f9b3e2f0000-    7f9b3e577000   \               rpcrt4
ELF     7f9b3e577000-    7f9b3e90b000   Deferred        ole32<elf>
  \-PE      7f9b3e5a0000-    7f9b3e90b000   \               ole32
ELF     7f9b3e90b000-    7f9b3eb64000   Deferred        winmm<elf>
  \-PE      7f9b3e910000-    7f9b3eb64000   \               winmm
ELF     7f9b3eb64000-    7f9b3ed7d000   Deferred        userenv<elf>
  \-PE      7f9b3eb70000-    7f9b3ed7d000   \               userenv
ELF     7f9b3ed7d000-    7f9b3efaa000   Deferred        iphlpapi<elf>
  \-PE      7f9b3ed90000-    7f9b3efaa000   \               iphlpapi
ELF     7f9b3efaa000-    7f9b3f1bd000   Deferred        psapi<elf>
  \-PE      7f9b3efb0000-    7f9b3f1bd000   \               psapi
ELF     7f9b3f1bd000-    7f9b3f3d7000   Deferred        libz.so.1
ELF     7f9b3f3d7000-    7f9b3f648000   Deferred        dbghelp<elf>
  \-PE      7f9b3f3e0000-    7f9b3f648000   \               dbghelp
ELF     7f9b3f648000-    7f9b3f862000   Deferred        version<elf>
  \-PE      7f9b3f650000-    7f9b3f862000   \               version
ELF     7f9b3f862000-    7f9b3faf8000   Deferred        advapi32<elf>
  \-PE      7f9b3f870000-    7f9b3faf8000   \               advapi32
ELF     7f9b3faf8000-    7f9b3fe5e000   Deferred        gdi32<elf>
  \-PE      7f9b3fb10000-    7f9b3fe5e000   \               gdi32
ELF     7f9b3fe5e000-    7f9b40209000   Deferred        user32<elf>
  \-PE      7f9b3fe80000-    7f9b40209000   \               user32
ELF     7f9b40209000-    7f9b404ed000   Deferred        msvcrt<elf>
  \-PE      7f9b40230000-    7f9b404ed000   \               msvcrt
ELF     7f9b404ed000-    7f9b406ff000   Deferred        libnss_files.so.2
ELF     7f9b406ff000-    7f9b4090b000   Deferred        libnss_nis.so.2
ELF     7f9b4090b000-    7f9b40b24000   Deferred        libnsl.so.1
ELF     7f9b40b24000-    7f9b40d2d000   Deferred        libnss_compat.so.2
ELF     7f9b4104d000-    7f9b41263000   Deferred        libgcc_s.so.1
ELF     7f9b41263000-    7f9b4156c000   Deferred        libm.so.6
ELF     7f9b4156f000-    7f9b41773000   Deferred        libdl.so.2
ELF     7f9b41773000-    7f9b41b3c000   Dwarf           libc.so.6
ELF     7f9b41b3d000-    7f9b41d5a000   Deferred        libpthread.so.0
ELF     7f9b41d67000-    7f9b4210d000   Dwarf           libwine.so.1
ELF     7f9b4210f000-    7f9b42337000   Deferred        ld-linux-x86-64.so.2
ELF     7fff897f2000-    7fff897f3000   Deferred        [vdso].so
Threads:
process  tid      prio (all id:s are in hex)
00000008 wineconsole.exe
    00000027    0
    00000009    0
0000000e services.exe
    0000001f    0
    0000001e    0
    00000016    0
    00000010    0
    0000000f    0
00000012 winedevice.exe
    0000001b    0
    0000001a    0
    00000013    0
00000014 explorer.exe
    00000024    0
    00000023    0
    00000022    0
    00000015    0
0000001c plugplay.exe
    00000021    0
    00000020    0
    0000001d    0
00000025 julia.exe
    0000002e    0
    0000002d    0
    0000002c    0
    0000002b    0
    0000002a    0
    00000029    0
    00000028    0
    00000026    0
00000085 (D) Z:\root\julia-win64-build\usr\bin\julia.exe
    00000086    0 <==
System information:
    Wine build: wine-1.9.16-110-g2b61293
    Platform: x86_64
    Version: Windows XP
    Host system: Linux
    Host version: 4.7.0-rc6-custom-withsigpatch
Keno commented 8 years ago

Backtrace of the message complaining about the segfault:

1|debug > timejump e783545
We have arrived.
wine client error:28: write: Bad file descriptor
Stopped in function _raw_syscall
   0x00007f058d103446<+33>: movq    $582, %r11
   0x00007f058d10344d<+40>: movq    $-1, %rcx
=> 0x00007f058d103454<+47>: callq   *32(%rsp)
   0x00007f058d103458<+51>: xorl    %ecx, %ecx
   0x00007f058d10345a<+53>: movq    $-1, %rcx
1|debug > bt
[1] _raw_syscall
[2] traced_raw_syscall
[3] syscall_hook
[4] _syscall_hook_trampoline
[5] _syscall_hook_trampoline_89_c2_f7_da
[6] pthread_sigmask
[7] wine_server_call
[8] NtCreateEvent
[9] UnhandledExceptionFilter
[10] __wine_exception_handler
[11] call_stack_handlers
[12] raise_exception
[13] raise_segv_exception
[14] raise_func_trampoline
[15] jl_get_global_for(char const*, void*, llvm::Module*)
[16] julia_gv(char const*, _jl_sym_t*, _jl_module_t*, void*)
[17] global_binding_pointer(_jl_module_t*, _jl_sym_t*, jl_binding_t**, bool, jl_codectx_t*)
[18] emit_getfield(_jl_value_t*, _jl_sym_t*, jl_codectx_t*)
[19] emit_expr(_jl_value_t*, jl_codectx_t*)
[20] emit_jlcall(llvm::Value*, llvm::Value*, _jl_value_t**, unsigned long long, jl_codectx_t*)
[21] emit_call(jl_expr_t*, jl_codectx_t*)
[22] emit_expr(_jl_value_t*, jl_codectx_t*)
[23] emit_condition(_jl_value_t*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, jl_codectx_t*)
[24] emit_expr(_jl_value_t*, jl_codectx_t*)
[25] emit_stmtpos(_jl_value_t*, jl_codectx_t*)
[26] emit_function(_jl_lambda_info_t*, _jl_llvm_functions_t*)
[27] jl_compile_linfo
[28] jl_compile_for_dispatch  at /root/julia-win64-build/src/gf.c:1311
[29] jl_apply_generic  at /root/julia-win64-build/src/julia_internal.h:184
[30] do_call  at /root/julia-win64-build/src/interpreter.c:66
[31] eval  at /root/julia-win64-build/src/interpreter.c:205
[32] do_call  at /root/julia-win64-build/src/interpreter.c:65
[33] eval  at /root/julia-win64-build/src/interpreter.c:205
[34] do_call  at /root/julia-win64-build/src/interpreter.c:65
[35] eval  at /root/julia-win64-build/src/interpreter.c:205
[36] eval  at /root/julia-win64-build/src/interpreter.c:264
[37] eval_body  at /root/julia-win64-build/src/interpreter.c:562
[38] jl_toplevel_eval_flex  at /root/julia-win64-build/src/toplevel.c:552
[39] jl_parse_eval_all  at /root/julia-win64-build/src/ast.c:717
[40] jl_load  at /root/julia-win64-build/src/toplevel.c:596
[41] _julia_init  at /root/julia-win64-build/src/init.c:687
[42] julia_init
[43] wmain  at /root/julia-win64-build/ui/repl.c:236
[44] __tmainCRTStartup
[45] mainCRTStartup
[46] start_process
[47] call_thread_func
[48] call_thread_entry_point
[49] start_process
[50] wine_call_on_stack
[51] wine_switch_to_stack  at ../../../wine/libs/wine/port.c:77
[52] LdrInitializeThunk
[53] __wine_kernel_init
[54] __wine_process_init
[55] wine_init  at ../../../wine/libs/wine/loader.c:956
[56] wine client error:28: write: Bad file descriptor
Keno commented 8 years ago
15|debug > rc
Stopped in function jl_get_global_for(char const*, void*, llvm::Module*)
   0x0000000000d2f0d1<+241>:    movb    $0, 481(%rbp)
   0x0000000000d2f0d8<+248>:    movq    $0, 488(%rbp)
=> 0x0000000000d2f0e3<+259>:    movq    16(%rbx), %r12
   0x0000000000d2f0e7<+263>:    leaq    16(%rax), %rdx
   0x0000000000d2f0eb<+267>:    movq    24(%rbx), %rax
1|debug > reg rbx
0x0000000092630000
Keno commented 8 years ago

Looks like it's trying to load the std::string vtable?

    6f64f0a9:   e8 8a 97 fe ff          callq  6f638838 <_ZNSt8ios_baseC2Ev>
    6f64f0ae:   48 8b 1d 1b 5d 0f 00    mov    0xf5d1b(%rip),%rbx        # 6f744dd0 <__fu1__ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE>
Keno commented 8 years ago
(gdb) p *(void**)0xe24dd0
$2 = (void *) 0x92630000
Keno commented 8 years ago

gdb/rr is showing an access somewhere around e272653, Arsenic is having trouble with watchpoints for some reason, so don't have a backtrace yet.

Keno commented 8 years ago

In object file:

0x0000000000fba5bc

First access:

1|debug > rsi
Stopped in function do_pseudo_reloc
   0x0000000000d194d1<+502>:    jmp 51
   0x0000000000d194d3<+504>:    movq    -32(%rbp), %rax
=> 0x0000000000d194d7<+508>:    movq    (%rax), %rax
   0x0000000000d194da<+511>:    movq    %rax, -48(%rbp)
   0x0000000000d194de<+515>:    jmp 39
1|debug > reg rax
0x0000000000e24dd0

1|debug > bt
[1] do_pseudo_reloc
[2] _pei386_runtime_relocator
[3] __DllMainCRTStartup
[4] DllMainCRTStartup
[5] MODULE_InitDLL
[6] process_attach.part.7
[7] process_attach.part.7
[8] attach_process_dlls
[9] wine_call_on_stack
[10] LdrInitializeThunk
[11] __wine_kernel_init
[12] __wine_process_init
[13] wine_init  at ../../../wine/libs/wine/loader.c:956
[14] <Unknown Module>

1|debug > when
Ticks: 0x000000000081dbf4
Time: 272653

Second/Third access:

Stopped in function __libc_freeres
   0x00007f058c8b236a<+394>:    movq    (%rsi), %rsi
   0x00007f058c8b236d<+397>:    movq    %rsi, (%rdi)
=> 0x00007f058c8b2370<+400>:    movq    %rcx, -8(%rdi,%rdx)
   0x00007f058c8b2375<+405>:    retq
   0x00007f058c8b2376<+406>:    nopw    %cs:(%rax,%rax)
1|debug > bt
[1] __libc_freeres
[2] MSVCRT_memcpy
[3] __write_memory
[4] do_pseudo_reloc
[5] _pei386_runtime_relocator
[6] __DllMainCRTStartup
[7] DllMainCRTStartup
[8] MODULE_InitDLL
[9] process_attach.part.7
[10] process_attach.part.7
[11] attach_process_dlls
[12] wine_call_on_stack
[13] LdrInitializeThunk
[14] __wine_kernel_init
[15] __wine_process_init
[16] wine_init  at ../../../wine/libs/wine/loader.c:956
[17] <Unknown Module>

1|debug > rsi
Stopped in function __libc_freeres
   0x00007f058c8b2365<+389>:    movq    -8(%rsi,%rdx), %rcx
   0x00007f058c8b236a<+394>:    movq    (%rsi), %rsi
=> 0x00007f058c8b236d<+397>:    movq    %rsi, (%rdi)
   0x00007f058c8b2370<+400>:    movq    %rcx, -8(%rdi,%rdx)
   0x00007f058c8b2375<+405>:    retq
1|debug > reg rsi
0x0000000092630000

1|debug > reg rdi
0x0000000000e24dd0

1|debug > when
Ticks: 0x000000000081dbff
Time: 272653
Keno commented 8 years ago

The second part os obviously suspicious. __libc_freeres, shouldn't be called, so something else is going wrong (or that's not __libc_freeres and the symblication is wrong, that's possible too).

Keno commented 8 years ago

Ok, does seem to be a symbolication problem. GDB thinks:

0x7f058c8b236d <__memmove_avx_unaligned+397>    mov    %rsi,(%rdi)
0x7f058c8b2370 <__memmove_avx_unaligned+400>    mov    %rcx,-0x8(%rdi,%rdx,1)
0x7f058c8b2375 <__memmove_avx_unaligned+405>    retq
Keno commented 8 years ago

Perhaps time to build wine with debug info and step through the relocator.

Keno commented 8 years ago

Oh, huh, do_pseudo_reloc seems to be a mingw thing not a wine thing.

Ok, debug version of wine is all good to go. New spacetime coordinates:

Keno commented 8 years ago

Looking at the pseudo relocations in libjulia.dll:

julia> COFF.dump_pseudo_relocs(h)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5e4,0x001c4eb0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5bc,0x001c4dd0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a404,0x001c5060,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b034,0x001c4dc0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b024,0x001c4da0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b02c,0x001c4db0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b4f4,0x001c4e20,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5dc,0x001c4ea0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5ec,0x001c4ec0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5c4,0x001c4de0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b4fc,0x001c4e30,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a60c,0x001c4f00,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5f4,0x001c4ed0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a604,0x001c4ef0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5d4,0x001c4e00,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5fc,0x001c4ee0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5cc,0x001c4df0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035a614,0x001c4f10,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b524,0x001c4e80,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b4ec,0x001c4e10,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b51c,0x001c4e70,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035ae14,0x001c4d90,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b504,0x001c4e40,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b534,0x001c4fe0,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b50c,0x001c4e50,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b514,0x001c4e60,0x00000040)
item = COFF.runtime_pseudo_reloc_item_v2(0x0035b52c,0x001c4e90,0x00000040)

I'm gonna go ahead and guess that

item = COFF.runtime_pseudo_reloc_item_v2(0x0035a5bc,0x001c4dd0,0x00000040)

is the one in question, which would put the import slot at

0x0035a5bc + (0xe24dd0-0x001c4dd0) == 0x00fba5bc

which was the address that was at that slot, before? Weird, but looking at the relocation code, that seems like the way it's supposed to be:

      /* Adjust the relocation value */
      reldata -= ((ptrdiff_t) base + r->sym);
      reldata += addr_imp;
Keno commented 8 years ago

Ok, so it does look like mingw is simply copying what the wine dyld is putting there:

julia> Gallium.load(sess, RemotePtr{UInt64}(0x0000000000fba5bc))
0x0000000092630000

(this is at the first load of that address). Let's see where that comes from.

Keno commented 8 years ago

Most recent reference:

1|debug > rc
Stopped in function import_dll
   0x000000007bc5efbc<+1488>:   movq    -184(%rbp), %rdi
   0x000000007bc5efc3<+1495>:   callq   -1792
=> 0x000000007bc5efc8<+1500>:   movq    %rax, (%r15)
   0x000000007bc5efcb<+1503>:   testq   %rax, %rax
   0x000000007bc5efce<+1506>:   jne 107
1|debug > reg rax
0x0000000092630000
1|debug > reg r15
0x0000000000fba5bc
1|debug > when
Ticks: 0x000000000032e72e
Time: 245981

I'm a little confused why I don't have debuginfo though, since I rebuilt with debuginfo.

Keno commented 8 years ago

Ok, fixed in Gallium:

In loader.c:566
681               pe_name = get_rva( module, (DWORD)import_list->u1.AddressOfData );
682               thunk_list->u1.Function = (ULONG_PTR)find_named_export( imp_mod, exports, exp_size,
683                                                                       (const char*)pe_name->Name,
684                                                                       pe_name->Hint, load_path );

1|debug > bt
[1] import_dll  at ../../../wine/dlls/ntdll/loader.c:682
[2] fixup_imports  at ../../../wine/dlls/ntdll/loader.c:915
[3] load_native_dll  at ../../../wine/dlls/ntdll/loader.c:1821
[4] load_dll  at ../../../wine/dlls/ntdll/loader.c:2299
[5] import_dll  at ../../../wine/dlls/ntdll/loader.c:601
[6] fixup_imports  at ../../../wine/dlls/ntdll/loader.c:915
[7] LdrInitializeThunk  at ../../../wine/dlls/ntdll/loader.c:3095
[8] __wine_kernel_init  at ../../../wine/dlls/kernel32/process.c:1302
Keno commented 8 years ago
1|C++ > (char*)pe_name->Name
(char *) "_ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE"
Keno commented 8 years ago

Ok, so it's trying to import that symbol from:

(rr) p (char*)get_rva(module, exports->Name)
$17 = 0x2384d1e "libstdc++-6.dll"

which seems to be loaded at

0226f000-02270000 ---p 00000000 00:00 0
02270000-02271000 r-xp 00000000 fd:01 1750027                            /root/.local/share/rr/make-5/mmap_hardlink_20030_libstdc++-6.dll
02271000-02340000 r-xp 00000000 00:00 0
02340000-02344000 rwxp 00000000 00:00 0
02344000-02376000 r-xp 00000000 00:00 0
02376000-02378000 rwxp 00000000 00:00 0
02378000-023c4000 r-xp 00000000 00:00 0
023c4000-023c7000 rwxp 00000000 00:00 0
023c7000-023c8000 rwxp 00150000 fd:01 1750027                            /root/.local/share/rr/make-5/mmap_hardlink_20039_libstdc++-6.dll
023c8000-02a17000 r-xp 00000000 00:00 0
02a17000-02a59000 r-xp 0079e000 fd:01 1750027                            /root/.local/share/rr/make-5/mmap_hardlink_20043_libstdc++-6.dll
02a59000-02ad6000 r-xp 00000000 00:00 0
02ad6000-02b1e000 r-xp 0085c000 fd:01 1750027                            /root/.local/share/rr/make-5/mmap_hardlink_20045_libstdc++-6.dll
Keno commented 8 years ago

Well, I understand why it's doing what it's doing:

Export {
  Ordinal: 4931
  Name: _ZTSy
  RVA: 0x903C0000
}
Export {
  Ordinal: 4932
  Name: _ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE
  RVA: 0x903C0000
}

Don't know yet what it's supposed to be doing though.

Keno commented 8 years ago

Well, Wine appears to be doing everything correctly. If I move the stdc++-6.dll from my linux box to the windows box everything crashes in the same place. Unfortunately, that must mean that something is bust about my toolchain, which is unfortunate, because I just followed the cross compile instructions.

Keno commented 8 years ago

My latest theory is that this is the ABI tags disaster, somehow exposed trough a not-up-to-date .def file, but we'll see.

Keno commented 8 years ago

link line:

libtool: link:  /root/mingw-w64-dgn/build/bc_gcc/./gcc/xgcc -shared-libgcc -B/root/mingw-w64-dgn/build/bc_gcc/./gcc -nostdinc++ -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/src -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/root/mingw-w64-dgn/cross/x86_64-w64-mingw32/lib -L/root/mingw-w64-dgn/cross/mingw/lib -isystem /root/mingw-w64-dgn/cross/x86_64-w64-mingw32/include -isystem /root/mingw-w64-dgn/cross/mingw/include -B/root/mingw-w64-dgn/cross/x86_64-w64-mingw32/bin/ -B/root/mingw-w64-dgn/cross/x86_64-w64-mingw32/lib/ -isystem /root/mingw-w64-dgn/cross/x86_64-w64-mingw32/include -isystem /root/mingw-w64-dgn/cross/x86_64-w64-mingw32/sys-include    -shared -nostdlib /root/mingw-w64-dgn/cross/x86_64-w64-mingw32/lib/dllcrt2.o /root/mingw-w64-dgn/build/bc_gcc/./gcc/crtbegin.o  .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o .libs/compatibility-condvar.o  -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a -Wl,--no-whole-archive  -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/src -L/root/mingw-w64-dgn/build/bc_gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/root/mingw-w64-dgn/cross/x86_64-w64-mingw32/lib -L/root/mingw-w64-dgn/cross/mingw/lib -L/root/mingw-w64-dgn/build/bc_gcc/./gcc -L/root/mingw-w64-dgn/cross/x86_64-w64-mingw32/bin -L/root/mingw-w64-dgn/cross/mingw/lib/../lib -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /root/mingw-w64-dgn/build/bc_gcc/./gcc/crtend.o  -Wl,-O1 -Wl,--gc-sections -Wl,--version-script=libstdc++-symbols.ver   -o .libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libstdc++.dll.a
tkelman commented 8 years ago

Which cross compile instructions? Exactly what gcc version did you use, and with what configure flags?

Keno commented 8 years ago

https://github.com/JuliaLang/julia/blob/master/README.windows.md#cross-building-julia-without-vagrant

~/cross-w64/bin/x86_64-w64-mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=/root/cross-w64/bin/x86_64-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/root/cross-w64/bin/../libexec/gcc/x86_64-w64-mingw32/6.1.0/lto-wrapper
Target: x86_64-w64-mingw32
Configured with: /root/mingw-w64-dgn/source/gcc-6.1.0/configure --target=x86_64-w64-mingw32 --disable-nls --disable-multilib --with-gmp=/root/mingw-w64-dgn/build/for_cross --with-mpfr=/root/mingw-w64-dgn/build/for_cross --with-mpc=/root/mingw-w64-dgn/build/for_cross --with-isl=/root/mingw-w64-dgn/build/for_cross --enable-languages=c,c++,objc,obj-c++,fortran --disable-libstdcxx-pch --prefix=/root/mingw-w64-dgn/cross --with-sysroot=/root/mingw-w64-dgn/cross
Thread model: win32
gcc version 6.1.0 (GCC)
tkelman commented 8 years ago

I see this too with i686-w64-mingw32, and I think it's more likely a GCC 5+ issue, not a Wine issue.

Keno commented 8 years ago

Yes, something is awry in gcc land.

Keno commented 8 years ago

Though the opensuse-built libstdc++-6.dll library seems fine, so something else is up.

tkelman commented 8 years ago

I suspect it works on 64 bit but not 32, and the difference might be that its libstdc++ was built with --enable-fully-dynamic-string which is an ABI difference. 4.9.2-2 from Cygwin works on both 32 and 64 bit, but the maintainer just uploaded 5.4.0-1 and 5.4.0-2 (the latter of which works on 64 bit but not 32) so you can't get 4.9.2-2 any more. I might upload my local copies to S3 so we have a backup available, along with modified setup.ini's if the maintainer doesn't get 4.9.2-2 reinstated as prev like I've asked him to.

Keno commented 8 years ago

I suspect it works on 64 bit but not 32

Not sure what you're saying, I'm building x86_64 binaries.

tkelman commented 8 years ago

Sure, but if you were building i686 binaries then the opensuse gcc 6.1 toolchain is also broken right now.

Keno commented 8 years ago

I'll try rebuilding with my cross compiler with --enable-fully-dynamic-string and see if that hides the segfault.

Keno commented 8 years ago

Doesn't seem to made a difference :(

Keno commented 8 years ago

I built a new GNU ld from trunk and it does not exhibit this problem (when built with -O0 at least).

Keno commented 8 years ago

I can however, reproduce this with binutils 2.26. Will bisect the linker to determine what the fix was and make sure it's adequately regression tested upstream (i.e. not an accidental rearrangement that could reoccur).

Keno commented 8 years ago

Apparently fixed by:

commit 4153b6dbb0f38a16fd5b583761aa811212fbb9a5
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Mar 22 12:25:08 2016 +0000

    Improve COFF/PE linker garbage collection by preventing the removal of sections containing exported symbols.

        PR ld/19803
        * ldlang.c (lang_add_gc_name): New function.  Adds the provided
        symbol name to the list of gc symbols.
        (lang_process): Call lang_add_gc_name with entry_symbol_default if
        entry_symbol.name is NULL.  Use lang_add_gc_name to add the init
        and fini function names.
        * pe-dll.c (process_def_file_and_drectve): Add exported names to
        the gc symbol list.
        * testsuite/ld-pe/pr19803.s: Do not export _testval symbol.
        * testsuite/ld-pe/pr19803.d: Tweak expected output.

So we need to make sure that all windows builds use binutils >= 2.27 (gc-sections may be a newish feature so older binutils are probably ok as well) or we leave a minefield of invalid export tables in our shared libaries.

Keno commented 8 years ago

Also cross reference to the thread where this was originally reported: https://sourceware.org/ml/binutils/2016-03/msg00112.html

Keno commented 8 years ago

Gonna close this issue since there is an upstream release that fixes it, but something to keep in mind for releases, etc.

tkelman commented 8 years ago

The opensuse cross-binutils has been applying several related patches already though. https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-binutils https://build.opensuse.org/package/show/windows:mingw:win32/mingw32-binutils

Keno commented 8 years ago

Right, as a I said, I couldn't reproduce this with the opensuse binaries. If yours was with those binaries, you may have to provide more details so I can take a look.

tkelman commented 8 years ago

Do an i686 build.

Keno commented 8 years ago

Ok, will try.