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 :-)
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 :-)
https://github.com/pleriche/FastMM4/issues/18
ReplyDeleteHeap corruption in your code I expect
ReplyDeleteStefan 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.
ReplyDeleteDavid Heffernan thanks. I don't explicitly allocate any memory, so I guess I should be looking at classes & interfaces then.
ReplyDeleteEr, just read Stefan's analysis. Seems like a balls up from Emba.
ReplyDeleteThanks David.
ReplyDelete