http://bugs.winehq.org/show_bug.cgi?id=35320
Bug ID: 35320 Summary: wine crash in MSVCRT__mbstowcs_l regarding locale, & other minor locale related problems Product: Wine Version: 1.7.10 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: htl10@users.sourceforge.net Classification: Unclassified
Created attachment 47106 --> http://bugs.winehq.org/attachment.cgi?id=47106 The file needed to cause the crash.
from r project (http://www.r-project.org/) http://cran.ma.imperial.ac.uk/bin/windows/base/R-2.15.3-win.exe
After installing, running:
./wine ~/.wine/drive_c/Program\ Files/R/R-2.15.3/bin/R.exe
Then, at the R console prompt, type (having put the attached file at /tmp/1.R):
Sys.setlocale("LC_CTYPE", "Chinese") source('z:/tmp/1.R', encoding='UTF8')
wine immediately crashes with: -------------------------------------- wine: Unhandled page fault on read access to 0x00000000 at address 0x7eda29af (thread 0030), starting debugger... ...
Backtrace: =>0 0x7eda29af MSVCRT__mbstowcs_l+0x5f(wcstr=<couldn't compute location>, mbstr=<couldn't compute location>, count=<couldn't compute location>, locale=<couldn't compute location>) [/home/Nobak-Hin-Tak/tmp-git/wine/dlls/msvcrt/mbcs.c:2140] in msvcrt (0x0440a168) 1 0x7eda2b06 MSVCRT_mbstowcs+0x35(wcstr="as a &Metafile CTRL+W", mbstr=0x0(nil), count=0x64) [/home/Nobak-Hin-Tak/tmp-git/wine/dlls/msvcrt/mbcs.c:2161] in msvcrt (0x0440a198) 2 0x6355b525 in rgraphapp (+0x1b524) (0x00030046) 0x7eda29af MSVCRT__mbstowcs_l+0x5f [/home/Nobak-Hin-Tak/tmp-git/wine/dlls/msvcrt/mbcs.c:2140] in msvcrt: movzbl 0x0(%eax),%eax 2140 if(mbstr[size] == '\0') ... ----------------------------------------
I assume this info in the backtrace should be enough to address the crash.
FYI, the slightly unusual procedure is because under R under Vista in an English locale doesn't like to plot graphs with non-latin annotations/texts. The above procedure when used under Vista on British English windows would result in R displaying an almost empty plot with a chinese title. Native R on linux does not need the setlocale part to plot utf8-based texts.
Also R on Vista accepts 'Sys.setlocale("LC_CTYPE", "Chinese_China.950")'. I only realized that trying to set traditional chinese [950] in a simplified chinese region [china] is wrong when it is rejected on linux; but R on Vista accepts this.
------------ Warning message: In Sys.setlocale("LC_CTYPE", "Chinese_China.950") : OS reports request to set locale to "Chinese_China.950" cannot be honored ------------
When R is running on Vista, it reports the locale as "English_United Kingdom.1252".
But under Linux (in en_GB.utf8 locale), R warns of
----------- During startup - Warning messages: 1: Setting LC_TIME=en_GB.utf8 failed 2: Setting LC_MONETARY=en_GB.utf8 failed -----------
So three locale related issue:
- a crash in msvcrt - R under Vista accepts "Chinese_China.950" but R under wine does not. - there are locale-related warning messages from R on start up when running under wine.