Range check error inside trunk win32 GetLocalStr code
Original Reporter info from Mantis: Pierre @PierreMuller
-
Reporter name: Pierre Muller
Original Reporter info from Mantis: Pierre @PierreMuller
- Reporter name: Pierre Muller
Description:
Bug probably introduced by rev 49244,
and thus assigned to Marco
Breakpoint 1, GETLOCALESTR (LID=1036, LT=40, DEF=0x82632c 'AM', result=0x110d120c 'dddd d MMMM yyyy') at C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp:1044
1044 begin
(gdb) n
1045 L := GetLocaleInfoW(LID, LT, nil, 0);
(gdb)
1046 if L > 0 then
(gdb)
1048 SetLength(Buf,L-1); // L includes terminating NULL
(gdb) p L
$2 = 1
(gdb) n
1049 L := GetLocaleInfoW(LID, LT, @Buf[1], L);
(gdb) p LT
$3 = 40
(gdb) p L
$4 = 1
(gdb) n
An unhandled exception occurred at $0042A7E2:
ERangeError: Range check error
$0042A7E2 GETLOCALESTR, line 1049 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B035 GETLOCALEFORMATSETTINGS, line 1219 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B365 GETFORMATSETTINGS, line 1242 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B59B INITINTERNATIONAL, line 1321 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042C740 SYSUTILS_$$_init$, line 1864 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0041106A fpc_initializeunits, line 1101 of C:/pas/pure-trunk/fpcsrc/rtl/inc/system.inc
$00401AB8 main, line 292 of pp.pas
Program exited with code 0331.
(gdb)
Steps to reproduce:
cycle trunk revision 49246 on i386-win32 with
make distclean cycle OPT="-n -glttt -CriotR"
Additional information:
ppc1.exe fails even to report version:
C:\pas\pure-trunk\fpcsrc\compiler>ppc1 -iV
An unhandled exception occurred at $0042A7E2:
ERangeError: Range check error
$0042A7E2 GETLOCALESTR, line 1049 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B035 GETLOCALEFORMATSETTINGS, line 1219 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B365 GETFORMATSETTINGS, line 1242 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042B59B INITINTERNATIONAL, line 1321 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0042C740 SYSUTILS_$$_init$, line 1864 of C:/pas/pure-trunk/fpcsrc/rtl/win/sysutils.pp
$0041106A fpc_initializeunits, line 1101 of C:/pas/pure-trunk/fpcsrc/rtl/inc/system.inc
$00401AB8 main, line 292 of pp.pas
Mantis conversion info:
- Mantis ID: 38791
- OS: win32
- Build: 20:49246
- Platform: i386
- Version: 3.3.1
- Fixed in revision: 49250 (#8ad6271f)