Hi all

Hi all,

I'm looking to hunt down a bug & I could do with a little advice?

I'm getting an Access Violation when the InstHashMap singleton finalizes. More specifically in TMonitor.Destroy the Access Violation occurs on the following line (#18089 in Berlin):

if (MonitorSupport <> nil) and (FLockEvent <> nil) then

The pointer "FLockEvent" is not NIL, but clearly doesn't have a valid pointer.

This problem has occurred since I added an FMX form & associated code to this VCL application. I've tried to replicate the problem in a test application, but (as you might guess) the problem doesn't occur, because all the FLockEvents are NIL during finalization.

I don't really know enough about this topic -- so I'd be interested to know what sort of code would produce a non-nil pointer in a TMonitor in a TInstBucket in the InstHashMap singleton?

In other words, what should I be doing to provoke this? What sort of code should be looking for in the original app?

Apologies if this is too broad a topic -- as I said I don't have a lot of experience/knbowledge of TMonitor/InstHashMap.

TIA :-)

Comments

  1. Heap corruption in your code I expect

    ReplyDelete
  2. Stefan Glienke Thanks, that's exactly the issue. I set NeverUninstall in FastMM4 and problem goes away. I confess I've not been able to replicate it any other FMX app though.

    ReplyDelete
  3. David Heffernan thanks. I don't explicitly allocate any memory, so I guess I should be looking at classes & interfaces then.

    ReplyDelete
  4. Er, just read Stefan's analysis. Seems like a balls up from Emba.

    ReplyDelete

Post a Comment