AV in with statement
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
There goes something wrong with register allocation in
with statement and checkpointer. It was very hard to isolate.
ppc386 -g -glh -OG2 project1.pas (OK):
getrow called
getrow called
Heap dump by heaptrc unit
20 memory blocks allocated : 845/880
20 memory blocks freed : 845/880
0 unfreed memory blocks : 0
True heap size : 360448 (16 used in System startup)
True free heap : 360432
$80482a8 &LtPos;TFIXROWS1__PAINT>: push %ebp
- $80482a9 &LtPos;TFIXROWS1__PAINT+1>: mov %esp,%ebp
- $80482ab &LtPos;TFIXROWS1__PAINT+3>: sub $0x44,%esp
- $80482ae &LtPos;TFIXROWS1__PAINT+6>: mov %ebx,0xffffffbc(%ebp)
- $80482b1 &LtPos;TFIXROWS1__PAINT+9>: mov %esi,0xffffffc0(%ebp)
- $80482b4 &LtPos;TFIXROWS1__PAINT+12>: mov %eax,0xfffffff8(%ebp)
- $80482b7 &LtPos;TFIXROWS1__PAINT+15>: mov %edx,0xfffffffc(%ebp)
180 with info,rowinfo do begin
80482ba &LtPos;TFIXROWS1__PAINT+18>: mov %edx,%ebx
181 //test:= info.rowinfo.cols.count; //this works
182 test:= cols.count; //this not
- $80482bc &LtPos;TFIXROWS1__PAINT+20>: mov 0x4(%ebx),%esi
- $80482bf &LtPos;TFIXROWS1__PAINT+23>: mov %esi,%eax
- $80482c1 &LtPos;TFIXROWS1__PAINT+25>: mov (%esi),%edx
- $80482c3 &LtPos;TFIXROWS1__PAINT+27>: mov 0x64(%edx),%edx
- $80482c6 &LtPos;TFIXROWS1__PAINT+30>: call *%edx
- $80482c8 &LtPos;TFIXROWS1__PAINT+32>: mov %eax,0x80a6b4c
ppc386 -g -glhc -OG2 project1.pas (AV):
An unhandled exception occurred at $00000000 :
EAccessViolation : Access violation
Heap dump by heaptrc unit
25 memory blocks allocated : 978/1032
18 memory blocks freed : 821/848
7 unfreed memory blocks : 157
True heap size : 458752 (16 used in System startup)
True free heap : 458080
Should be : 458160
Call trace for block $4006804C size 44
$0804CBEE
....
$80482c8 &LtPos;TFIXROWS1__PAINT>: push %ebp
- $80482c9 &LtPos;TFIXROWS1__PAINT+1>: mov %esp,%ebp
- $80482cb &LtPos;TFIXROWS1__PAINT+3>: sub $0x50,%esp
- $80482ce &LtPos;TFIXROWS1__PAINT+6>: mov %ebx,0xffffffb0(%ebp)
- $80482d1 &LtPos;TFIXROWS1__PAINT+9>: mov %esi,0xffffffb4(%ebp)
- $80482d4 &LtPos;TFIXROWS1__PAINT+12>: mov %edi,0xffffffb8(%ebp)
- $80482d7 &LtPos;TFIXROWS1__PAINT+15>: mov %eax,0xfffffff8(%ebp)
- $80482da &LtPos;TFIXROWS1__PAINT+18>: mov %edx,0xfffffffc(%ebp)
180 with info,rowinfo do begin
- $80482dd &LtPos;TFIXROWS1__PAINT+21>: mov %edx,%ebx
- $80482df &LtPos;TFIXROWS1__PAINT+23>: mov %ebx,0xffffffbc(%ebp)
181 //test:= info.rowinfo.cols.count; //this works
182 test:= cols.count; //this not
- $80482e2 &LtPos;TFIXROWS1__PAINT+26>: mov %ebx,%eax
- $80482e4 &LtPos;TFIXROWS1__PAINT+28>: call $805d8d8 &LtPos;HEAPTRC_CHECKPOINTER$POINTER>
- $80482e9 &LtPos;TFIXROWS1__PAINT+33>: mov 0x4(%ebx),%eax
- $80482ec &LtPos;TFIXROWS1__PAINT+36>: mov (%ebx),%edx
- $80482ee &LtPos;TFIXROWS1__PAINT+38>: mov 0x64(%edx),%edx
- $80482f1 &LtPos;TFIXROWS1__PAINT+41>: call *%edx
- $80482f3 &LtPos;TFIXROWS1__PAINT+43>: mov %eax,0x80a6b4c
183
Additional information:
Reporter: Martin Schreiber
EMail:
Mantis conversion info:
- Mantis ID: 6065
- OS: Linux
- Fixed in version: 2.0.4