| |
Issue ID: 00082 |
|   |   |
|
Project: Abakus VCL State: All 15.Nov.07 18:36 |
Subject: Access after destroy in TTimerThread Description: I have a BIG project that includes many different components - when the application terminates, FastMM reports a problem. I'm pretty confident there's nothing actually wrong, but it bothers me. Would you have a suggestion of where I might look to resolve this? Thanks. --------------------------------2007/11/15 12:45:36-------------------------------- FastMM has detected an error during a free block scan operation. FastMM detected that a block has been modified after being freed. The previous block size was: 72 Stack trace of when this block was previously allocated (return addresses): 402E94 [System][@GetMem] 4042EF [System][TObject.NewInstance] 4046DA [System][@ClassCreate] 619D61 [_AbFlash.pas][_AbFlash][TTimerThread.Create][75] 40A765 [FastMM4][UpdateHeaderAndFooterCheckSums] 40B496 [FastMM4][DebugGetMem] 619E5F [_AbFlash.pas][_AbFlash][TAbFlash.Create][104] 61A1DF [AbFlashT.pas][AbFlashT][TAbFlashTimer.Create][123] 61A140 [AbFlashT.pas][AbFlashT][CreateTimer][101] 61A763 [AbFlashT.pas][AbFlashT][AddControl][337] The block was previously used for an object of class: TTimerThread The allocation number was: 14124 Stack trace of when the block was previously freed (return addresses): 402EBF [System][@FreeMem] 40430D [System][TObject.FreeInstance] 404725 [System][@ClassDestroy] 43643A [Classes.pas][Classes][TThread.Destroy][9441] 404353 [System][TObject.Free] 4362EA [Classes.pas][Classes][ThreadProc][9382] 4362F9 [Classes.pas][Classes][ThreadProc][9384] 40518A [System][ThreadWrapper] 7C57B3BC [lstrcmpiW] The current stack trace leading to this error (return addresses): 40C524 [FastMM4][CheckBlocksOnShutdown] 40D463 [FastMM4][Finalization] 404DCB [System][FinalizeUnits] 4050A6 [System][@Halt0] 6F4701 [D:\Projects\Code\Navitas\SEM\ptestagain.dpr][ptestagain][ptestagain][32] 7C5989D5 [ProcessIdToSessionId] Current memory dump of 256 bytes starting at pointer address 21C5700: 80 1C 70 00 80 80 80 80 80 80 80 80 80 01 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 82 6E F4 7B 80 80 80 80 80 80 80 80 80 80 80 80 00 00 00 00 F1 54 1C 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C5 38 00 00 94 2E 40 00 EF 42 40 00 DA 46 40 00 D6 0B 62 00 21 3F 62 00 24 F8 42 00 55 FA 42 00 02 FD 42 00 70 FC 42 00 E9 6C 43 00 BF 2E 40 00 0D 43 40 00 25 47 40 00 E7 0C 62 00 53 43 40 00 84 3D 62 00 FD 43 4A 00 22 A3 4A 00 E4 92 52 00 FD 43 4A 00 50 00 00 00 78 E2 61 00 C4 D3 49 08 80 1C 70 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 . p . . n τ { . . . . ρ T . . . . . . . . . . . . . . . . . . Ε 8 . . . @ . ο B @ . Ϊ F @ . Φ . b . ! ? b . $ ψ B . U ϊ B . . ύ B . p ό B . ι l C . Ώ . @ . . C @ . % G @ . η . b . S C @ . = b . ύ C J . " £ J . δ R . ύ C J . P . . . x β a . Δ Σ I . . p . Files: TestFlash.zip (361 kB) |
16.Nov.07 22:05 | Comment: Hi Ed, please send us a demo application wich shows the failure. |
30.Nov.07 8:57 | Comment: I added 'testflash.zip' to previous comment. It has a simple application, project source, the fastmm_FullDebugMode.dll (in case you don't use FastMM) and the fastMM4Options.inc file that has my fastMM settings. There are 3 tests, but actually 4 - click on 'set range error' and close the application with the title bar close [x]. It's easy to duplicate - if the application closes with an AbFlash 'flashing' there's an error related to TTimerThread on closing application. Let me know if there's anything else I can do. |
26.Feb.08 23:59 | Comment: Hi Achim. I added the requested demo application to the very first message in November (instead of to my reply to you). Have you had a chance to review? Cheers, EdB |
11.Aug.09 20:14 | Comment: I purchased VCL v.3.50 and discovered the same problem but with different gagues and of course timer driven task. I solved it. For the Form1 you go to the object inspector in C++Builder and find "OnDestroy" in Events tab. Double click it and add the line: Timer1->Enabled=false;. You will stop timer before the application closes. The code will look like: //--------------------------------------------------------------------------- void __fastcall TForm1::FormDestroy(TObject *Sender) { Timer1->Enabled=false; } //--------------------------------------------------------------------------- No more error but we can discuss why it helped :-) |