SysErrorMessage crashes whith HeapTrace enabled (fpc 3.0.2rc1).
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
A call to SysErrorMessage will crash a program if heaptrace is enabled.
This happens with fpc 3.0.2RC1 (which I cannot select from the "Product version" dropdown list).
Steps to reproduce:
program test;
uses sysutils;
begin
writeln('SysErrorMessage(193)=',SysErrorMessage(193));
end.
Build with -gh
Free Pascal Compiler version 3.0.2rc1 [2016/12/20] for i386
C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
Marked memory at $001C4D78 invalid
Wrong size : 255 allocated 510 freed
$0040D639
$00408C76
$004015A8
Call trace for block $001C4D78 size 255
$004015A8
SysErrorMessage(193)=Heap dump by heaptrc unit
48 memory blocks allocated : 1385/1496
47 memory blocks freed : 1640/1752
1 unfreed memory blocks : -255
True heap size : 196608 (112 used in System startup)
True free heap : 196160
Should be : 196688
Call trace for block $001C4D78 size 255
$004015A8
Additional information:
It crashes on win32 and win64.
I did not test any other environment.
(The value of the argument to SysErrorMessage does not matter)
The crash does not occur with 3.0.0 or trunk (r35221).
Please fix this before releasing 3.0.2, since it makes debugging my programs virtually impossible.
Mantis conversion info:
- Mantis ID: 31197
- OS: Windows
- OS Build: Win7
- Platform: i386
- Fixed in version: 3.0.2
- Fixed in revision: 35247 (#093344f8)