Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2008 Jul : Issue with FastFreeMem (FastMM V4.70)
| Subject: | Issue with FastFreeMem (FastMM V4.70) |
| Posted by: | "Francois Piette [ICS & Midware]" (francois.piet..@overbyte.be) |
| Date: | Mon, 28 Jul 2008 11:41:44 |
Hi !
I have a large multithreaded application which experience an access
violation always at the same place from time to time.
The AV occurs in "function FastFreeMem(APointer: Pointer): Integer;" at line
4209 (See source extract below, line marked "here"). The AV is either write
at address 00000000 or write at address 00000001.
This happend randomly about once per day which is very unfrequent given the
fact that the application is a server program used by something like 700
users 24h/24. That is still too much.
I have no idea about what can cause the issue. It looks like a dynamic issue
because this always happend when serevral threads are contending.
IsMultithread variable is set to TRUE. AssumeMultiThreaded is not defined.
Any idea about finding the cause of this AV is really welcome !
Extract from FastMM4.pas:
@LockBlockTypeLoop:
mov eax, $100
{Attempt to grab the block type}
lock cmpxchg TSmallBlockType([ebx]).BlockTypeLocked, ah
<===== HERE is the AV
je @GotLockOnSmallBlockType
{$ifndef NeverSleepOnThreadContention}
{Couldn't grab the block type - sleep and try again}
push ecx
push edx
push InitialSleepTime
call Sleep
pop edx
pop ecx
{Try again}
mov eax, $100
{Attempt to grab the block type}
lock cmpxchg TSmallBlockType([ebx]).BlockTypeLocked, ah
je @GotLockOnSmallBlockType
{Couldn't grab the block type - sleep and try again}
push ecx
push edx
push AdditionalSleepTime
call Sleep
--
francois.piette@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be