Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[FastMM] Is ScanMemoryPoolForCorruptions multithread safe ?

44 views
Skip to first unread message

Francois Piette [ICS & Midware]

unread,
Jul 30, 2008, 10:44:55 AM7/30/08
to
Is ScanMemoryPoolForCorruptions multithread safe ?
I read in the source code: "It can be called at any time, but is only
available in FullDebugMode.".
What happend if a thread execute ScanMemoryPoolForCorruptions while another
thread is doing memory alloc/free ? Could it cause a false alarm about
corruption ?

--
francoi...@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


Pierre le Riche

unread,
Jul 31, 2008, 6:16:37 AM7/31/08
to
> Is ScanMemoryPoolForCorruptions multithread safe ?

It is now <g>. I just uploaded 4.86.

Thanks for pointing that out.

Regards,
Pierre

Francois Piette [ICS & Midware]

unread,
Jul 31, 2008, 7:39:44 AM7/31/08
to
> > Is ScanMemoryPoolForCorruptions multithread safe ?
>
> It is now <g>. I just uploaded 4.86.
>
> Thanks for pointing that out.

Thanks for having fixed it. Already downloaded, recompiled and redeployed
the application. Will let you know the result.

Regards,

Francois Piette [ICS & Midware]

unread,
Jul 31, 2008, 8:48:27 AM7/31/08
to
> > Is ScanMemoryPoolForCorruptions multithread safe ?
> It is now <g>. I just uploaded 4.86.

Well, I think it is not yet thread safe.
I have recompiled my application with 4.86.
IsMultithread is TRUE
FullDebug is enabled
FullDebugModeScanMemoryPoolBeforeEveryOperation is TRUE

I run the application and feed it with a lot of concurrent requests so a lot
of threads are created.
ScanMemoryPoolForCorruptions detect corruptions. I have put a breakpoint in
RaiseMemoryCorruptionError so looking at the call stack, I see from where
the corruption is detected: It is always from ScanMemoryPoolForCorruptions
call I do myself from the mainthread and never when called from DebugGetMem
!

My analysis is that the call of ScanMemoryPoolForCorruptions I explicitely
do happend while worker threads are using the memory manager and
ScanMemoryPoolForCorruptions report inexistant corruption.

What do you think ?

Pierre le Riche

unread,
Aug 1, 2008, 3:21:44 AM8/1/08
to
Hi Francois,

> My analysis is that the call of ScanMemoryPoolForCorruptions I explicitely
> do happend while worker threads are using the memory manager and
> ScanMemoryPoolForCorruptions report inexistant corruption.
>
> What do you think ?

I sifted through the code again and I can't see anything suspect. The
first thing that ScanMemoryPoolForCorruptions now does is to lock all
small and medium blocks so there should be no other activity in the
memory manager while the memory pool is being scanned.

Are you absolutely positive that you're running the EXE compiled with
4.86? Perhaps I'm going blind, but I can't see how it could detect
corruptions where there are none.

If you can send me the logs with the stack traces I'll try to make sense
of it.

Regards,
Pierre

0 new messages