In normal mode (i.e. not "FullDebugMode"), the address space surrounding a block may be released to the operating system when a block is freed, so it is not always possible for FastMM to catch such a double free "gracefully". That said, double frees should almost always crash your application (either through above A/V or another exception raised by FastMM) so the end result is the same.
Best regards,
Pierre
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Date: 14 Nov 2013 09:51:02
Address: 00408D96
ClassName: EAccessViolation
Message: Access violation at address 00408D96 in module 'BatPost.exe'. Read of address 00000002
IsOSException: 1
Modules:
00400000 20131114075057 C:\ritserver\EXE\BatPost.exe
Stack:
00408D96 [00400000][FastMM4][FastMM4.GetAvailableSpaceInBlock][3310]
0040AD1A [00400000][FastMM4][FastMM4.CheckBlockBeforeFreeOrRealloc][8810]
0040AD95 [00400000][FastMM4][FastMM4.DebugFreeMem][8857]
004030B4 [00400000][System][System.@FreeMem][2699]
005507C5 [00400000][BatPost][BatPost.BatPost][436]
AllocatedByRoutine can be used in CheckBlockBeforeFreeOrRealloc to determine that memory block is already freed before calling GetAvailableSpaceInBlock.
Last edit: Igor 2013-11-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Igor,
In normal mode (i.e. not "FullDebugMode"), the address space surrounding a block may be released to the operating system when a block is freed, so it is not always possible for FastMM to catch such a double free "gracefully". That said, double frees should almost always crash your application (either through above A/V or another exception raised by FastMM) so the end result is the same.
Best regards,
Pierre
Here is exception log in FullDebugMode:
Date: 14 Nov 2013 09:51:02
Address: 00408D96
ClassName: EAccessViolation
Message: Access violation at address 00408D96 in module 'BatPost.exe'. Read of address 00000002
IsOSException: 1
Modules:
00400000 20131114075057 C:\ritserver\EXE\BatPost.exe
Stack:
00408D96 [00400000][FastMM4][FastMM4.GetAvailableSpaceInBlock][3310]
0040AD1A [00400000][FastMM4][FastMM4.CheckBlockBeforeFreeOrRealloc][8810]
0040AD95 [00400000][FastMM4][FastMM4.DebugFreeMem][8857]
004030B4 [00400000][System][System.@FreeMem][2699]
005507C5 [00400000][BatPost][BatPost.BatPost][436]
AllocatedByRoutine can be used in CheckBlockBeforeFreeOrRealloc to determine that memory block is already freed before calling GetAvailableSpaceInBlock.
Last edit: Igor 2013-11-14