I tried cross compiling a c++ app with mingw in f14 and run it in wine
and it kept crashing at startup. I stripped the app down to the small
example below and it still crashes with the output after the example.
The same test app works in fedora 12 and Ubuntu 10.10. I haven't tried
running it under fedora 13 or in Windows instead of wine. If I
make bar() non virtual it doesn't crash, but it's not really an option
for the original application. Any ideas?
Thanks,
Dave
class Foo {
virtual void bar();
virtual ~Foo() {;}
};
void Foo::bar()
{
}
int main()
{
return 0;
}
[idht4n@localhost /tmp]$ i686-pc-mingw32-g++ foo.cpp
Info: resolving vtable for __cxxabiv1::__class_type_info by linking to
__imp___ZTVN10__cxxabiv117__class_type_infoE (auto-import)
/usr/lib/gcc/i686-pc-mingw32/4.5.0/../../../../i686-pc-mingw32/bin/ld:
warning: auto-importing has been activated without
--enable-auto-import specified on the command line.
This should work unless it involves constant data structures
referencing symbols from auto-imported DLLs.
[idht4n@localhost /tmp]$ ./a.
a.exe* a.out*
[idht4n@localhost /tmp]$ cd /usr/i686-pc-mingw32/sys-root/mingw/bin
[idht4n@localhost bin]$ /tmp/a.exe
wine: Unhandled page fault on write access to 0x00403028 at address
0x40142f (thread 0009), starting debugger...
Unhandled exception: page fault on write access to 0x00403028 in
32-bit code (0x0040142f).
Register dump:
CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b
EIP:0040142f ESP:0061fe2c EBP:0061fe30 EFLAGS:00010206( R- -- I - -P- )
EAX:00403050 EBX:00400000 ECX:00000008 EDX:00403028
ESI:7ffdf000 EDI:00401130
Stack dump:
0x0061fe2c process_envvars+0x79c: 684aa758 0061fe70 0040108d 00404000
0x0061fe3c process_envvars+0x7ac: 00404004 0061fe64 ffffffff 0061fe60
0x0061fe4c process_envvars+0x7bc: 00000000 00000000 00000000 00000000
0x0061fe5c process_envvars+0x7cc: 00000000 00000000 00112ad8 684aa758
0x0061fe6c process_envvars+0x7dc: 684aa758 0061fe90 00401148 00000001
0x0061fe7c: 68026b22 00000000 00000000 00000000
Backtrace:
=>0 0x0040142f in a (+0x142f) (0x0061fe30)
1 0x0040108d __mingw_CRTStartup+0x6c()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:217] in a
(0x0061fe70)
2 0x0040108d __mingw_CRTStartup+0x6c()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:217] in a
(0x0061fe90)
3 0x00401148 mainCRTStartup+0x17()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:257] in a
(0x0061fea8)
4 0x6846dbdc call_process_entry+0xb() in kernel32 (0x0061fee8)
5 0x68389bf0 call_thread_func+0xb() in ntdll (0x0061fef8)
6 0x6838c871 call_thread_entry_point+0x70() in ntdll (0x0061ffc8)
7 0x6836214b call_dll_entry_point+0x65a() in ntdll (0x0061ffe8)
0x0040142f: addl %ecx,0x0(%edx)
Modules:
Module Address Debug info Name (17 modules)
PE 400000- 411000 Dwarf a
ELF 61e000- 640000 Export ld-linux.so.2
ELF 642000- 7d5000 Deferred libc.so.6
ELF 7d7000- 7dc000 Deferred libdl.so.2
ELF 7de000- 7fa000 Deferred libpthread.so.0
ELF 7fc000- 826000 Deferred libm.so.6
ELF 7fc000- 826000 Deferred libm.so.6
ELF 68318000-683e0000 Export ntdll<elf>
\-PE 68330000-683e0000 \ ntdll
ELF 6840a000-68417000 Deferred libnss_files.so.2
ELF 68417000-6859b000 Export kernel32<elf>
\-PE 68430000-6859b000 \ kernel32
ELF 6859b000-68629000 Deferred msvcrt<elf>
\-PE 685b0000-68629000 \ msvcrt
PE 6cec0000-6cf2c000 Deferred libgcc_s_sjlj-1
PE 6fc40000-7011c000 Deferred libstdc++-6
ELF 7bf00000-7bf03000 Deferred <wine-loader>
Threads:
process tid prio (all id:s are in hex)
00000008 (D) Z:\tmp\a.exe
00000009 0 <==
0000000e services.exe
00000016 0
00000015 0
00000014 0
00000010 0
0000000f 0
00000011 winedevice.exe
00000018 0
00000017 0
00000013 0
00000012 0
00000019 explorer.exe
0000001a 0
Backtrace:
=>0 0x0040142f in a (+0x142f) (0x0061fe30)
1 0x0040108d __mingw_CRTStartup+0x6c()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:217] in a
(0x0061fe70)
2 0x0040108d __mingw_CRTStartup+0x6c()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:217] in a
(0x0061fe90)
3 0x00401148 mainCRTStartup+0x17()
[/builddir/build/BUILD/mingwrt-3.15.2-mingw32/crt1.c:257] in a
(0x0061fea8)
4 0x6846dbdc call_process_entry+0xb() in kernel32 (0x0061fee8)
5 0x68389bf0 call_thread_func+0xb() in ntdll (0x0061fef8)
6 0x6838c871 call_thread_entry_point+0x70() in ntdll (0x0061ffc8)
7 0x6836214b call_dll_entry_point+0x65a() in ntdll (0x0061ffe8)