Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Dec : EInvalidOp with FastCode move

www.cryer.info
Managed Newsgroup Archive

EInvalidOp with FastCode move

Subject:EInvalidOp with FastCode move
Posted by:"Michael J. Leaver" (spam@mjleaver.com)
Date:Fri, 8 Dec 2006 14:54:22

We have some code in production that is working fine for thousands of
customers. However, one customer can consistently reproduce a problem
which has me stumped.

We're using BDS 2006 (Update 2) and the madExcept report is below. As
you can see, it raises an exception when the FastCode Move code is
called when a string is added to a list. The call that triggers this is
a simple TStringList.AddObject('string', TObject(ptr)).

We're using a TTntStringList class instead of TStringList, but the code
for TTntStringList.AddObject and TTntStringList.InsertItem is identical
to that for TStringList (the only difference is WideString is used
instead of String).

The report below shows the exception being raised on line 334 of
System.pas, but that cannot be correct and I believe it is actually line
3698.

Anyone got any ideas?


operating system  : Windows XP Service Pack 2 build 2600
system language   : English
system up time    : 2 days 16 hours
program up time   : 1 day 23 hours
processors        : 2x Intel(R) Pentium(R) 4 CPU 3.20GHz
physical memory   : 1757/3071 MB (free/total)
free disk space   : (C:) 4.16 GB
display mode      : 1600x1200, 32 bit
process id        : $390
allocated memory  : 199.95 MB
madExcept version : 3.0b
callstack crc     : $fedba0ff, $6f7cf041, $8d116dcc
exception number  : 5
exception class   : EInvalidOp
exception message : Invalid floating point operation.

x ($b9c):
00403363 x.exe System          334   +0 Move
0048120b x.exe TntClasses     1269   +4 TTntStringList.InsertItem
00480d9f x.exe TntClasses     1109   +9 TTntStringList.AddObject
005befd8 x.exe TreeScanBase    537  +51 TBaseTreeScanner.AddToFileList

[snip]

cpu registers:
eax = 7f8d7f58
ebx = 010602b0
ecx = 00055198
edx = 7f8d7f60
esi = 00000fe9
edi = 10e27084
eip = 00403360
esp = 0e4edb24
ebp = 0e4edb38

stack dump:
0e4edb24  c0 07 08 00 10 12 48 00 - 08 67 3a 0d 84 70 e2 10
......H..g:..p..
0e4edb34  ac b7 52 00 ac b7 52 00 - a5 0d 48 00 08 67 3a 0d
..R...R...H..g:.
0e4edb44  e9 0f 00 00 80 db 4e 0e - 28 48 5c 00 ac b7 52 00
......N.(H\...R.
0e4edb54  30 cb f9 00 db ef 5b 00 - 8c db 4e 0e 54 4f 40 00
0.....[...N.TO@.
0e4edb64  80 db 4e 0e 18 e9 3a 0d - 00 00 00 00 00 00 00 00
..N...:.........
0e4edb74  ff ff ff ff 18 e9 3a 0d - 00 00 00 00 08 df 4e 0e
......:.......N.
0e4edb84  33 57 5c 00 ac de 4e 0e - 98 db 4e 0e 54 4f 40 00
3W\...N...N.TO@.
0e4edb94  08 df 4e 0e 24 df 4e 0e - 54 4f 40 00 08 df 4e 0e
..N.$.N.TO@...N.
0e4edba4  28 48 5c 00 0c 00 00 00 - 01 00 00 00 00 00 00 00
(H\.............
0e4edbb4  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edbc4  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edbd4  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edbe4  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edbf4  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edc04  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edc14  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edc24  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edc34  00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
................
0e4edc44  00 00 00 00 00 00 00 00 - 00 00 00 00 10 00 00 00
................
0e4edc54  00 98 77 17 44 a5 c5 01 - f2 bb 80 53 c3 19 c7 01
..w.D......S....

disassembling:
[...]
00403357       fild    qword ptr [eax]
00403359       add     ecx, edx
0040335b       and     ecx, -8
0040335e       sub     ecx, edx
00403360       fild    qword ptr [ecx+eax]
00403363     > fistp   qword ptr [ecx+edx]
00403366       sub     ecx, 8
00403369       jg      loc_403360
0040336b       pop     ecx
0040336c       fistp   qword ptr [edx]
0040336e       fistp   qword ptr [ecx+edx]
[...]

Replies:

www.cryer.info
Managed Newsgroup Archive