http://bugs.winehq.org/show_bug.cgi?id=19971
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |focht@gmx.net Component|-unknown |msvcrt Summary|NFS: Undercover crashes |NFS: Undercover crashes |upon launch |upon launch (msvcrt locale | |init) Ever Confirmed|0 |1
--- Comment #5 from Anastasius Focht focht@gmx.net 2011-10-13 16:20:40 CDT --- Hello,
there is a crash in msvcrt startup/init phase without entry point of app/game reached yet.
Trace log:
--- snip --- ... 002a:trace:msvcrt:MSVCRT__create_locale (0 C) 002a:Call ntdll.RtlAllocateHeap(00110000,00000000,00000008) ret=7e6a0d47 002a:Ret ntdll.RtlAllocateHeap() retval=0014ba38 ret=7e6a0d47 ... 002a:Ret ntdll.RtlAllocateHeap() retval=0014bd50 ret=7e6a0d47 002a:trace:msvcrt:_unlock (19) 002a:Call ntdll.RtlAllocateHeap(00110000,00000008,00000228) ret=7e6c5931 002a:Ret ntdll.RtlAllocateHeap() retval=00150a18 ret=7e6c5931 002a:Call KERNEL32.GetACP() ret=7e6a8bbc 002a:Ret KERNEL32.GetACP() retval=000004e4 ret=7e6a8bbc 002a:warn:seh:setup_exception_record exception outside of stack limits in thread 002a eip 7e6a1e9a esp bfffcf40 stack 0x1e82000-0x2380000 002a:trace:seh:raise_exception code=c0000005 flags=0 addr=0x7e6a1e9a ip=7e6a1e9a tid=002a 002a:trace:seh:raise_exception info[0]=00000001 002a:trace:seh:raise_exception info[1]=7fffa587 002a:trace:seh:raise_exception eax=bfffd5d4 ebx=7e6f5ff4 ecx=00000000 edx=bfffcff8 esi=bfffcf74 edi=0000003b 002a:trace:seh:raise_exception ebp=00000000 esp=bfffcf40 cs=0073 ds=007b es=007b fs=0033 gs=003b flags=00010282 002a:trace:seh:call_vectored_handlers calling handler at 0x7df03cf0 code=c0000005 flags=0 002a:trace:seh:call_vectored_handlers handler at 0x7df03cf0 returned 0 002a:err:seh:raise_exception Exception frame is not in stack limits => unable to dispatch exception. --- snip ---
Winedbg:
--- snip --- ~/.wine/drive_c/Program Files/EA Games/Need for Speed Undercover$ winedbg ./nfs.exe WineDbg starting on pid 0029 Unhandled exception: page fault on write access to 0x7fffa277, invalid program stack in 32-bit code (0x7e697eba). Register dump: CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b EIP:7e697eba ESP:bfffce30 EBP:00000000 EFLAGS:00010282( R- -- I S - - - ) EAX:bfffd3d4 EBX:7e6ebff4 ECX:00000000 EDX:bfffcee9 ESI:bfffce64 EDI:0000003a Stack dump: 0xbfffce30: bfffd3d4 0000005f 00110440 00110440 0xbfffce40: b7e76b2e 7d9f0000 00135450 00000040 0xbfffce50: 00000000 00000001 bfffd3d4 bfffd3d4 0xbfffce60: b7e76b2e 3130322e 00003732 00000000 0xbfffce70: 00000000 00000000 00000000 00000000 0xbfffce80: 00000000 00000000 00000000 00000000 Backtrace: =>0 0x7e697eba MSVCRT_locale_to_LCID+0x12a(locale=".20127") [/home/focht/projects/wine/wine-git/dlls/msvcrt/locale.c:236] in msvcrt (0x00000000) 0x7e697eba MSVCRT_locale_to_LCID+0x12a [/home/focht/projects/wine/wine-git/dlls/msvcrt/locale.c:236] in msvcrt: movb $0x0,0x73(%esp,%eax,1) 236 search.search_country[cp-region-1] = '\0'; --- snip ---
msvcrt_init_locale() -> MSVCRT__create_locale(0, "C") -> _setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, loc->mbcinfo) -> MSVCRT_locale_to_LCID(".20127")
Offending code:
http://source.winehq.org/git/wine.git/blob/fea69b230546cd8145c67e9f94b3e8f0f...
--- snip dlls/msvcrt/locale.c --- 214 LCID MSVCRT_locale_to_LCID(const char *locale) 215 { ... 222 cp = strchr(locale, '.'); 223 region = strchr(locale, '_'); 224 225 lstrcpynA(search.search_language, locale, MAX_ELEM_LEN); 226 if(region) { 227 lstrcpynA(search.search_country, region+1, MAX_ELEM_LEN); 228 if(region-locale < MAX_ELEM_LEN) 229 search.search_language[region-locale] = '\0'; 230 } else 231 search.search_country[0] = '\0'; 232 233 if(cp) { 234 lstrcpynA(search.search_codepage, cp+1, MAX_ELEM_LEN); 235 if(cp-region-1 < MAX_ELEM_LEN) 236 search.search_country[cp-region-1] = '\0'; 237 if(cp-locale < MAX_ELEM_LEN) 238 search.search_language[cp-locale] = '\0'; 239 } else 240 search.search_codepage[0] = '\0'; --- snip dlls/msvcrt/locale.c ---
"region" will be NULL through this caller path (_setmbcp_l) hence you can't use it (line 235/236).
$ wine --version wine-1.3.30-108-gb80b8f5
The copy protection works fine, just for completeness a ProtectionID dump:
--- snip --- -=[ ProtectionID v0.6.4.0 JULY]=- (c) 2003-2010 CDKiLLER & TippeX Build 07/08/10-17:57:05 Ready... Scanning -> H:.wine\drive_c\Program Files\EA Games\Need for Speed Undercover\nfs.exe File Type : 32-Bit Exe (Subsystem : Win CUI / 3), Size : 16151824 (0F67510h) Byte(s) -> File Appears to be Digitally Signed @ Offset 0F66000h, size : 01510h / 05392 byte(s) [File Heuristics] -> Flag : 00000000000000000000000000000101 (0x00000005) [!] SecuROM Detected - Version 07.38.0012 [!] Possible CD/DVD-Key or Serial Check -> CDKey [CompilerDetect] -> Visual C++ 8.0 (Visual Studio 2005) - Scan Took : 0.62 Second(s)
Scanning -> H:.wine\drive_c\Program Files\EA Games\Need for Speed Undercover\paul.dll File Type : 32-Bit Dll (Subsystem : Win GUI / 2), Size : 262144 (040000h) Byte(s) [File Heuristics] -> Flag : 00000000000000001000000000000000 (0x00008000) [!] SecuROM Modified PA Module Detected [!] Possible CD/DVD-Key or Serial Check -> registration code [CompilerDetect] -> Visual C++ 8.0 (Visual Studio 2005) - Scan Took : 0.420 Second(s) --- snip ---
Regards