Einzelnen Beitrag anzeigen

schwa226

Registriert seit: 4. Apr 2008
400 Beiträge
 
#6

Re: Absturz beim Beenden wenn Thread ausgeführt wurde

  Alt 6. Jan 2010, 19:41
Danke für den Tipp mit dem FreeOnTerminate!

Nun habe ich noch ein weiteres kleines Problem beim beenden meiner TestApp.

Bei meiner VMWare gibt es keine Probleme, bei meinem echten PC bekomme ich aber folgenden madexcept Report:
Code:
compiled with    : Delphi 2009
madExcept version : 3.0k
callstack crc    : $03ba442a, $fc0a2d5f, $fc0a2d5f
exception number : 1
exception class  : EInvalidPointer
exception message : Ungültige Zeigeroperation.

main thread ($15c4):
00404229 +011 MyTestApp.exe   System    375   +0 TObject.FreeInstance
0040479a +002 MyTestApp.exe   System    375   +0 @ClassDestroy
0040425d +009 MyTestApp.exe   System    375   +0 TObject.Destroy
0040426c +008 MyTestApp.exe   System    375   +0 TObject.Free
005851bb +11f MyTestApp.exe   acSBUtils 1137  +21 UninitializeACScroll
0058a566 +04e MyTestApp.exe   acSBUtils 2915   +7 TacScrollWnd.acWndProc
005905d5 +035 MyTestApp.exe   acSBUtils 4483   +2 TacBaseWnd.acWndProc
0058accb +02f MyTestApp.exe   acSBUtils 3055   +8 TacEditWnd.acWndProc
004d5b2c +02c MyTestApp.exe   Controls           TWinControl.MainWndProc
0047c1d4 +014 MyTestApp.exe   Classes            StdWndProc
76eb642b +02b ntdll.dll                       KiUserCallbackDispatcher
759fd5f9 +00a USER32.dll                      DestroyWindow
004d54dc +028 MyTestApp.exe   Controls           TWinControl.DestroyWindowHandle
004ebc97 +033 MyTestApp.exe   Forms              TCustomForm.DestroyWindowHandle
004e885b +073 MyTestApp.exe   Forms              TCustomForm.Destroy
0047b3cf +047 MyTestApp.exe   Classes            TComponent.DestroyComponents
004e6a6d +035 MyTestApp.exe   Forms              DoneApplication
0045b646 +026 MyTestApp.exe   SysUtils           DoExitProc
004053dd +021 MyTestApp.exe   System    375   +0 @Halt0
005e6c10 +7c8 MyTestApp.exe   MyTestApp     228 +183 initialization
75561172 +010 kernel32.dll                    BaseThreadInitThunk

thread $11c0:
76eb5e4a +0a ntdll.dll    NtWaitForMultipleObjects
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $ec0:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $17bc:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $16a8:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $b0:
76eb4c1a +0a ntdll.dll               NtDelayExecution
75241870 +4f KERNELBASE.dll          SleepEx
75241813 +0a KERNELBASE.dll          Sleep
0045573d +0d MyTestApp.exe     madExcept CallThreadProcSafe
004557a7 +37 MyTestApp.exe     madExcept ThreadExceptFrame
75561172 +10 kernel32.dll            BaseThreadInitThunk
>> created by thread $16c4 at:
76c9642e +00 ole32.dll

thread $173c: <priority:15>
75a08fbd +26 USER32.dll            GetMessageW
0045573d +0d MyTestApp.exe   madExcept CallThreadProcSafe
004557a7 +37 MyTestApp.exe   madExcept ThreadExceptFrame
75561172 +10 kernel32.dll          BaseThreadInitThunk
>> created by thread $630 at:
7560480b +00 SHLWAPI.dll

thread $1778:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $e94:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $95c:
76eb5e6a +0a ntdll.dll               NtWaitForSingleObject
75241796 +66 KERNELBASE.dll          WaitForSingleObjectEx
7555effe +3e kernel32.dll            WaitForSingleObjectEx
7555efad +0d kernel32.dll            WaitForSingleObject
0045573d +0d MyTestApp.exe     madExcept CallThreadProcSafe
004557a7 +37 MyTestApp.exe     madExcept ThreadExceptFrame
75561172 +10 kernel32.dll            BaseThreadInitThunk
>> created by thread $838 at:
76c9642e +00 ole32.dll

thread $1010:
76eb5e7a +0a ntdll.dll    NtWaitForWorkViaWorkerFactory
75561172 +10 kernel32.dll BaseThreadInitThunk

thread $2d0:
76eb5d6a +0a ntdll.dll    NtTraceControl
76e8e9bb +3c ntdll.dll    EtwpNotificationThread
75561172 +10 kernel32.dll BaseThreadInitThunk

disassembling:
00404218     public System.TObject.FreeInstance: ; function entry point
00404218 375   push   ebx
00404219       mov    ebx, eax
0040421b      mov    eax, ebx
0040421d      call   +$a6 ($4042c8)        ; System.TObject.CleanupInstance
00404222       mov    eax, ebx
00404224       call   -$11a1 ($403088)      ; System.@FreeMem
00404229     > pop    ebx
0040422a      ret
Alle Threads die mit FreeOnTerminate = True ausgeführt werden sind beendet und somit auch nicht im Report.
Es wird irgenwo ein Speicher zweimal freigegeben. Jdeoch komme ich nicht darauf wo ich ansetzen soll!?

Kann mir da jemand einen Tipp geben?

Danke!
Delphi 2010, Update 4 & 5
  Mit Zitat antworten Zitat