http://bugs.winehq.org/show_bug.cgi?id=34687
Bug #: 34687 Summary: Port Royale 2 crashes on startup (SymGetLineFromAddr() returns unix-style path for source file) Product: Wine Version: 1.7.3 Platform: x86 OS/Version: Linux Status: NEW Severity: minor Priority: P2 Component: dbghelp AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello folks,
as the summary says ... The game bundles a native version of 'dbghelp.dll' which is used in their exception handling/stack analysis library code living in 'Walhalla.dll' to provide more information. Wine builtin is of course preferred/loaded.
The game engine uses custom C++ exception classes which retrieve some context information using dbghelp. After calling dbghelp.SymGetLineFromAddr(), strrchr() is used on the returned IMAGEHLP_LINE64.FileName member. This obviously won't work because Wine returns a unix-style path, leading to crash.
'strrchr' returns NULL -> input to STL basic_string() ctor
--- snip --- 0025:Call dbghelp.SymGetModuleInfo64(ffffffff,7bc8d47f,00000000,0033ad20) ret=00af4ad6 0025:Call KERNEL32.WideCharToMultiByte(00000000,00000000,00339794 L"ntdll",ffffffff,0033a44c,00000020,00000000,00000000) ret=7e5a69c2 0025:Ret KERNEL32.WideCharToMultiByte() retval=00000006 ret=7e5a69c2 ... 0025:Ret dbghelp.SymGetModuleInfo64() retval=00000001 ret=00af4ad6 0025:Call ntdll.RtlAllocateHeap(00dd3000,00000000,00000020) ret=7c3416b3 0025:Ret ntdll.RtlAllocateHeap() retval=00e29e78 ret=7c3416b3 0025:Call dbghelp.SymGetSymFromAddr64(ffffffff,7bc8d47f,00000000,0033ad18,0033abe8) ret=00af4b41 0025:Ret dbghelp.SymGetSymFromAddr64() retval=00000001 ret=00af4b41 0025:Call ntdll.RtlAllocateHeap(00dd3000,00000000,00000020) ret=7c3416b3 0025:Ret ntdll.RtlAllocateHeap() retval=0e9fefb0 ret=7c3416b3 0025:Call dbghelp.SymGetLineFromAddr64(ffffffff,7bc8d47f,00000000,00000000,0033ab70) ret=00af4b9d 0025:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7e5c219e ip=7e5c219e tid=0025 0025:trace:seh:raise_exception info[0]=00000001 0025:trace:seh:raise_exception info[1]=00000000 0025:trace:seh:raise_exception eax=00000000 ebx=7e5d9000 ecx=0000000e edx=0000000e esi=0033ab3c edi=0033ab04 0025:trace:seh:raise_exception ebp=0033aae8 esp=0033aa90 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00210202 --- snip ---
The actual code:
--- snip --- ... 0113D393 MOV DWORD PTR SS:[ESP+40],EDX 0113D397 MOV DWORD PTR SS:[ESP+30],14 0113D39F CALL DWORD PTR DS:[11E627C] ; dbghelp.SymGetLineFromAddr 0113D3A5 TEST EAX,EAX 0113D3A7 JE SHORT Walhalla.0113D3DE 0113D3A9 MOV EDX,DWORD PTR SS:[ESP+2C] 0113D3AD PUSH 5C 0113D3AF PUSH EDX 0113D3B0 CALL DWORD PTR DS:[11E61C0] ; MSVCR71.strrchr 0113D3B6 ADD ESP,8 0113D3B9 INC EAX 0113D3BA PUSH EAX 0113D3BB LEA ECX,DWORD PTR SS:[ESP+44] 0113D3BF CALL DWORD PTR DS:[11E63BC] ; stlport_.?assign@?$basic_string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@QAEAAV12@PBD@Z ... --- snip ---
Dump of IMAGEHLP_LINE64 structure returned by dbghelp.SymGetLineFromAddr:
--- snip --- 0033EF6C 0000000E 0033EF70 00000014 0033EF74 106AA4B4 0033EF78 0000035A 0033EF7C 0E62914C ASCII "/home/focht/projects/wine/wine-git/dlls/ntdll/thread.c" 0033EF80 7BC8D471 ntdll.7BC8D471 --- snip ---
Source: http://source.winehq.org/git/wine.git/blob/878ea7d9ea4bbb924a539ec2808867468...
--- snip --- 1435 BOOL symt_fill_func_line_info(const struct module* module, const struct symt_function* func, 1436 DWORD64 addr, IMAGEHLP_LINE64* line) 1437 { ... 1456 if (found) 1457 { 1458 line->FileName = (char*)source_get(module, dli->u.source_file); 1459 return TRUE; 1460 } ... --- snip ---
Starting the game with 'WINEDLLOVERRIDES=dbghelp=n' works around
Regards
http://bugs.winehq.org/show_bug.cgi?id=34687
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.fileplanet.com/1 | |44434/140000/fileinfo/Port- | |Royale-2-Demo-%5BEnglish%5D
--- Comment #1 from Anastasius Focht focht@gmx.net 2013-10-08 17:05:05 CDT --- Hello folks,
filling fields...
$ du -sh pr2_english_demo.exe 235M pr2_english_demo.exe
$ sha1sum pr2_english_demo.exe wi80cf15e36cc20cf502da4659d5d22cd1081eeba3 pr2_english_demo.exe
$ wine --version wine-1.7.3-313-gf46137f
Regards
http://bugs.winehq.org/show_bug.cgi?id=34687
GyB gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69@gmail.com
--- Comment #2 from GyB gyebro69@gmail.com 2013-10-09 09:25:33 CDT --- This could be the same issue as bug #21915. Setting dbghelp.dll to native works around the problem for me as well in PR2.
http://bugs.winehq.org/show_bug.cgi?id=34687
--- Comment #3 from Anastasius Focht focht@gmx.net 2013-10-09 16:44:05 CDT --- Hello GyB,
--- quote --- This could be the same issue as bug #21915. Setting dbghelp.dll to native works around the problem for me as well in PR2. --- quote ---
well, I actually opened this bug while trying to reproduce/investigate bug 21915 The crash/exception presented there was clearly different hence I created a separate bug. If the workaround makes the game fully running/playable (I didn't went further into actual game) then this is indeed a dupe.
Can you play the commercial (full) version of PR2 with the workaround?
Regards
http://bugs.winehq.org/show_bug.cgi?id=34687
--- Comment #4 from GyB gyebro69@gmail.com 2013-10-09 19:29:13 CDT --- (In reply to comment #3)
Hello GyB,
--- quote --- This could be the same issue as bug #21915. Setting dbghelp.dll to native works around the problem for me as well in PR2. --- quote ---
well, I actually opened this bug while trying to reproduce/investigate bug 21915 The crash/exception presented there was clearly different hence I created a separate bug. If the workaround makes the game fully running/playable (I didn't went further into actual game) then this is indeed a dupe.
Can you play the commercial (full) version of PR2 with the workaround?
Regards
Hi Anastasius,
I tested the gog.com version of the game, and got the same result either with Wine 1.2.3 or 1.7.3 when using the built-in dbghelp.dll: the game throws an error message 'Could not find translation files' then it crashes. With 'dbghelp=n' the game starts fine with both Wine versions for me.
http://bugs.winehq.org/show_bug.cgi?id=34687
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adrian@hoehne.tk
--- Comment #5 from Anastasius Focht focht@gmx.net 2013-10-10 00:33:26 CDT --- *** Bug 21915 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=34687
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com, | |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=34687
georg_mueller@safe-mail.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |georg_mueller@safe-mail.net
--- Comment #6 from georg_mueller@safe-mail.net ---
I tested the gog.com version of the game, and got the same result either with Wine 1.2.3 or 1.7.3 when using the built-in dbghelp.dll: the game throws an error message 'Could not find translation files' then it crashes. With 'dbghelp=n' the game starts fine with both Wine versions for me.
I also own PR2 from GOG $ md5sum PR2.exe 22546195b669394f651c96521d39d238 PR2.exe
$ env WINEDLLOVERRIDES="dbghelp=n" wine PR2.exe Will result sometimes in a crash with the following messsage: 'Could not find translation files'
Distro: Debian Jessie with own compiled Wine 1.9.,1
Any ideas?
https://bugs.winehq.org/show_bug.cgi?id=34687
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |p.beutner@gmx.net, | |winetest@luukku.com
https://bugs.winehq.org/show_bug.cgi?id=34687
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com
--- Comment #7 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Created attachment 56841 --> https://bugs.winehq.org/attachment.cgi?id=56841 Patch
Does this help?
https://bugs.winehq.org/show_bug.cgi?id=34687
--- Comment #8 from winetest@luukku.com --- (In reply to Alistair Leslie-Hughes from comment #7)
Created attachment 56841 [details] Patch
Does this help?
Yes it seems to help.
https://bugs.winehq.org/show_bug.cgi?id=34687
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=34687
--- Comment #9 from winetest@luukku.com --- I am deleting old downloads and retested this game. Without a patch crash, loads just fine with the patch. I started a game and it loads quite slowly with modern hardware. There is some issue drawing water, but other than that everything seemed just fine.
wine 2.0-git.
https://bugs.winehq.org/show_bug.cgi?id=34687
Zhiyi Zhang zzhang@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zzhang@codeweavers.com
--- Comment #10 from Zhiyi Zhang zzhang@codeweavers.com --- (In reply to Alistair Leslie-Hughes from comment #7)
Created attachment 56841 [details] Patch
Does this help?
Hi Alistair, how come this didn't get submitted to patch?
https://bugs.winehq.org/show_bug.cgi?id=34687
--- Comment #11 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to Zhiyi Zhang from comment #10)
(In reply to Alistair Leslie-Hughes from comment #7)
Created attachment 56841 [details] Patch
Does this help?
Hi Alistair, how come this didn't get submitted to patch?
https://www.winehq.org/pipermail/wine-devel/2017-February/116170.html
https://bugs.winehq.org/show_bug.cgi?id=34687
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |4aa7fbe0561e6a27f098a05a63c | |5a7d12397e678 Status|NEW |RESOLVED
--- Comment #12 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=4aa7fbe0561e6a27f098a05a6...
https://bugs.winehq.org/show_bug.cgi?id=34687
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.11.
https://bugs.winehq.org/show_bug.cgi?id=34687
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://www.fileplanet.com/1 |https://web.archive.org/web |44434/140000/fileinfo/Port- |/20210718180607/http://down |Royale-2-Demo-%5BEnglish%5D |load.fileplanet.com/ftp1/08 | |2004/pr2_english_demo.exe?s | |t=mosNWaEYCEe6WZeTJGnPow&e= | |1626642309