Einzelnen Beitrag anzeigen

Benutzerbild von s.h.a.r.k
s.h.a.r.k

Registriert seit: 26. Mai 2004
3.159 Beiträge
 
#1

Seltsames Problem mit MMSystem-Timer (TCKMultimediaTimer)

  Alt 22. Jun 2010, 12:58
Hallo zusammen,

ich programmiere mir gerade einen semitransparenten Overlay als Ladebildschirm, der sich dann über eine Form legt und dem Benutzer so signalisiert, dass etwas passiert. Den TTimer wollte ich zunächst aufgrund der groben Auflösung nicht nehmen und bin daher auf den sehr präzisen Timer in MMSystem gestoßen und habe mir diese in gekapselter Form aus der DP geholt. Hier mal der Link zur Komponente. Ich habe das Ganze nicht installiert, sondern direkt als Klasse eingebunden, was mir wesentlich lieber ist.

Nun ist es so, dass dieser Timer in einer "standalone"-Demoanwendung wunderbar funktioniert, nur wenn ich den in meine Produktivanwendung einpflege, so lässt sich der Overlay einmal einblenden, d.h. der Timer wird einmal instanziiert. Will ich das erneut machen, so meldet FastMM folgte Fehlermeldung:
Code:
---------------------------
tdm.exe: Memory Error Detected
---------------------------
FastMM has detected an error during a GetMem operation. FastMM detected that a block has been modified after being freed.



Modified byte offsets (and lengths): 8(12)



The previous block size was: 52



This block was previously allocated by thread 0xC7C, and the stack trace (return addresses) at the time was:

4047FA [System.pas][System][@GetMem][2979]

79E008 [frames\fMain.pas][fMain][TframeMain.OnStorageBeforeLoad][429]

6A14F6 [classes\StorageController.pas][StorageController][TStorageController.CallLoadEvent][371]

6A14C2 [classes\StorageController.pas][StorageController][TStorageController.WndProc][353]

756F6238 [Unknown function at gapfnScSendMessage]

756F68EA [Unknown function at gapfnScSendMessage]

756F7D31 [Unknown function at LoadStringW]

756F7DFA [DispatchMessageW]

4EF7BA [Forms.pas][Forms][TApplication.ProcessMessage][9760]



The block was previously used for an object of class: TCKMultimediaTimer



The allocation number was: 22628



The block was previously freed by thread 0xC7C, and the stack trace (return addresses) at the time was:

404816 [System.pas][System][@FreeMem][3030]

756F6238 [Unknown function at gapfnScSendMessage]

756F68EA [Unknown function at gapfnScSendMessage]

756F7D31 [Unknown function at LoadStringW]

756F7DFA [DispatchMessageW]

4EF7BA [Forms.pas][Forms][TApplication.ProcessMessage][9760]



The current thread ID is 0xC7C, and the stack trace (return addresses) leading to this error is:

4118C5 [FastMM4.pas][FastMM4][DebugGetMem][6725]

4047FA [System.pas][System][@GetMem][2979]

701929 [TB2Item.pas][TB2Item][TTBView.DoUpdatePositions][5045]

6FFADA [TB2Item.pas][TB2Item][TTBView.OpenChildPopup][4003]

70313F [TB2Item.pas][TB2Item][TTBModalHandler.Loop][6081]

7023CD [TB2Item.pas][TB2Item][TTBView.EnterToolbarLoop][5456]

7062C6 [TB2Toolbar.pas][TB2Toolbar][TTBCustomToolbar.MouseDown][1067]

717E69 [SpTBXItem.pas][SpTBXItem][TSpTBXToolbar.MouseDown][7388]

4C1B9D [Controls.pas][Controls][TControl.DoMouseDown][7201]

4C1BEC [Controls.pas][Controls][TControl.WMLButtonDown][7212]

4C5E0D [Controls.pas][Controls][TWinControl.WndProc][9819]



Current memory dump of 256 bytes starting at pointer address 7ED956D0:

74 82 7C 00 80 80 80 80 6E 60 CE 12 00 00 00 00 00 00 00 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 59 54 CB D2 00 00 00 00 30 53 D9 7E

00 00 00 00 00 00 00 00 64 18 41 00 00 00 00 00 8B D6 24 00 FA 47 40 00 97 FF 51 00 7C 21 53 00

91 23 53 00 97 31 53 00 B2 AC 68 00 39 D5 68 00 FF 12 6A 00 E5 4A 45 00 E2 6D 40 00 77 36 5F 75

28 10 00 00 16 48 40 00 6A 21 53 00 91 23 53 00 97 31 53 00 B2 AC 68 00 39 D5 68 00 FF 12 6A 00

E5 4A 45 00 E2 6D 40 00 77 36 5F 75 72 9D 5F 77 28 10 00 00 2A 00 00 00 B0 04 02 00 C8 8D A7 E7

B0 04 02 00 01 00 00 00 0E 00 00 00 4E 00 61 00 63 00 68 00 67 00 65 00 73 00 63 00 68 00 69 00

63 00 68 00 74 00 65 00 00 00 37 72 58 18 80 80 80 80 80 80 80 80 80 80 00 00 00 00 30 53 D9 7E

t ‚  |  . €  €  €  €  n `  Ī  . . . . . . . . . €  €  €  €  €  €  €  €  €  €  €  €

€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  Y T Ė  Ņ  . . . . 0  S Ł  ~

. . . . . . . . d . A . . . . . ‹  Ö  $  . ś  G @  . —  ˙  Q . |  !  S .

‘  #  S . —  1  S . ²  ¬  h . 9  Õ  h . ˙  . j . å  J E . ā  m @  . w 6  _  u

(  . . . . H @  . j !  S . ‘  #  S . —  1  S . ²  ¬  h . 9  Õ  h . ˙  . j .

å  J E . ā  m @  . w 6  _  u r ¯  _  w (  . . . *  . . . °  . . . Č  ¨  §  ē

°  . . . . . . . . . . . N . a . c . h . g . e . s . c . h . i .

c . h . t . e . . . 7  r X . €  €  €  €  €  €  €  €  €  €  . . . . 0  S Ł  ~


---------------------------
OK  
---------------------------
Anschließend folgt diese Exception von Delphi aus:
Code:
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt tdm.exe ist eine Exception der Klasse EOutOfMemory mit der Meldung 'Zu wenig Arbeitsspeicher' aufgetreten.
---------------------------
Anhalten  Fortsetzen  Hilfe  
---------------------------
Nutze ich statt dessen den TTimer klappt alles wunderbar. Mir ist irgendwie klar, dass es ein Thread-Problem ist, nur hab ich keinerlei Ahnung, wo ich überhaupt ansetzen sollte. Seltsam war gestern auch, dass dieser Fehler alleine durch das Öffnen von einem TB2000-MainMenu dieser Fehler aufgetreten ist...
»Remember, the future maintainer is the person you should be writing code for, not the compiler.« (Nick Hodges)
  Mit Zitat antworten Zitat