The application seems to be frozen in initialization

delphi package - automated exception handling
Post Reply
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

The application seems to be frozen in initialization

Post by ira »

I hate this error because I have no idea to fix this bug. This bug sometimes happens in my old project even in my new project :crazy:

Plase anyone give suggesion to find the problem. What shoud I do?

Code: Select all

callstack crc     : $d2389088, $931646d8, $44c2db51
exception number  : 1
exception message : The application seems to be frozen.

main thread ($9e0):
761966c7 +00a USER32.dll                     WaitMessage
005a7765 +149 Program.exe    Vcl.Forms         TApplication.Idle
005a698b +017 Program.exe    Vcl.Forms         TApplication.HandleMessage
005a6cb1 +0c9 Program.exe    Vcl.Forms         TApplication.Run
008cd1a8 +0c4 Program.exe    Program     115 +28 initialization
771fed6a +010 kernel32.dll                   BaseThreadInitThunk

thread $360:
77756a02 +0a ntdll.dll     NtWaitForMultipleObjects
771fed6a +10 kernel32.dll  BaseThreadInitThunk

thread $1190:
77756a02 +0a ntdll.dll                NtWaitForMultipleObjects
759a6a30 +00 KERNELBASE.dll           WaitForMultipleObjectsEx
771fbd19 +89 kernel32.dll             WaitForMultipleObjectsEx
771fbd87 +13 kernel32.dll             WaitForMultipleObjects
004bd371 +0d Program.exe      madExcept CallThreadProcSafe
004bd3db +37 Program.exe      madExcept ThreadExceptFrame
771fed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll             CreateThread

thread $11a0 (TWorkerThread):
77756a22 +0a ntdll.dll                             NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll                        WaitForSingleObjectEx
771fc2ee +3e kernel32.dll                          WaitForSingleObjectEx
771fc29d +0d kernel32.dll                          WaitForSingleObject
00686cda +16 Program.exe      VirtualTrees   6070 +3 TWorkerThread.Execute
004bd48f +2b Program.exe      madExcept              HookedTThreadExecute
00484636 +42 Program.exe      System.Classes         ThreadProc
004079f0 +28 Program.exe      System           45 +0 ThreadWrapper
004bd371 +0d Program.exe      madExcept              CallThreadProcSafe
004bd3db +37 Program.exe      madExcept              ThreadExceptFrame
771fed6a +10 kernel32.dll                          BaseThreadInitThunk
>> created by main thread ($9e0) at:
00407a5a +5a Program.exe      System           45 +0 BeginThread

thread $11a4:
777557d2 +0a ntdll.dll                                    NtDelayExecution
759a1870 +4f KERNELBASE.dll                               SleepEx
759a1813 +0a KERNELBASE.dll                               Sleep
006ccebf +6b Program.exe      VirtualShellNotifier 2281 +18 TVirtualChangeDispatchThread.Execute
005da47a +36 Program.exe      MPThreadManager       676 +22 TCommonThread.ExecuteStub
004bd371 +0d Program.exe      madExcept                     CallThreadProcSafe
004bd3db +37 Program.exe      madExcept                     ThreadExceptFrame
771fed6a +10 kernel32.dll                                 BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll                                 CreateThread

thread $11a8:
7619ce0e +26 USER32.dll                                 GetMessageW
006cc0bf +bb Program.exe    VirtualShellNotifier 1930 +15 TVirtualShellChangeThread.Execute
005da47a +36 Program.exe    MPThreadManager       676 +22 TCommonThread.ExecuteStub
004bd371 +0d Program.exe    madExcept                     CallThreadProcSafe
004bd3db +37 Program.exe    madExcept                     ThreadExceptFrame
771fed6a +10 kernel32.dll                               BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll                               CreateThread

thread $11b0:
77756a22 +0a ntdll.dll                              NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll                         WaitForSingleObjectEx
771fc2ee +3e kernel32.dll                           WaitForSingleObjectEx
771fc29d +0d kernel32.dll                           WaitForSingleObject
005daa5b +2f Program.exe      MPThreadManager 898  +4 TCommonEventThread.Execute
005da47a +36 Program.exe      MPThreadManager 676 +22 TCommonThread.ExecuteStub
004bd371 +0d Program.exe      madExcept               CallThreadProcSafe
004bd3db +37 Program.exe      madExcept               ThreadExceptFrame
771fed6a +10 kernel32.dll                           BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll                           CreateThread

thread $156c:
77756422 +0a ntdll.dll                NtReplyWaitReceivePort
00794f78 +30 Program.exe    madCodeHook LpcPortThread
004bd371 +0d Program.exe    madExcept   CallThreadProcSafe
004bd3db +37 Program.exe    madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll             CreateThread

thread $1570: <priority:1>
77756a22 +0a ntdll.dll                  NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
771fc2ee +3e kernel32.dll               WaitForSingleObjectEx
771fc29d +0d kernel32.dll               WaitForSingleObject
00794bfe +12 Program.exe      madCodeHook LpcDispatchThread
004bd371 +0d Program.exe      madExcept   CallThreadProcSafe
004bd3db +37 Program.exe      madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll               CreateThread

thread $1580:
77756422 +0a ntdll.dll                NtReplyWaitReceivePort
00794f78 +30 Program.exe    madCodeHook LpcPortThread
004bd371 +0d Program.exe    madExcept   CallThreadProcSafe
004bd3db +37 Program.exe    madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll             CreateThread

thread $1584: <priority:1>
77756a22 +0a ntdll.dll                  NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
771fc2ee +3e kernel32.dll               WaitForSingleObjectEx
771fc29d +0d kernel32.dll               WaitForSingleObject
00794bfe +12 Program.exe      madCodeHook LpcDispatchThread
004bd371 +0d Program.exe      madExcept   CallThreadProcSafe
004bd3db +37 Program.exe      madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by main thread ($9e0) at:
771fdcdd +1b kernel32.dll               CreateThread

thread $1604:
77756a22 +0a ntdll.dll                  NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
771fc2ee +3e kernel32.dll               WaitForSingleObjectEx
771fc29d +0d kernel32.dll               WaitForSingleObject
00794b47 +17 Program.exe      madCodeHook LpcWorkerThread
004bd371 +0d Program.exe      madExcept   CallThreadProcSafe
004bd3db +37 Program.exe      madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1584 at:
771fdcdd +1b kernel32.dll               CreateThread

thread $160c:
77756a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
771fed6a +10 kernel32.dll  BaseThreadInitThunk

thread $e74:
77756a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
771fed6a +10 kernel32.dll  BaseThreadInitThunk

thread $fe0:
77756a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
771fed6a +10 kernel32.dll  BaseThreadInitThunk

thread $15a8:
77756a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
771fed6a +10 kernel32.dll  BaseThreadInitThunk

thread $12fc:
77756a02 +0a ntdll.dll                NtWaitForMultipleObjects
759a6a30 +00 KERNELBASE.dll           WaitForMultipleObjectsEx
771fbd19 +89 kernel32.dll             WaitForMultipleObjectsEx
004bd371 +0d Program.exe      madExcept CallThreadProcSafe
004bd3db +37 Program.exe      madExcept ThreadExceptFrame
771fed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $16c4 at:
771fdcdd +1b kernel32.dll             CreateThread

thread $171c:
77756a22 +0a ntdll.dll                  NtWaitForSingleObject
759a1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
771fc2ee +3e kernel32.dll               WaitForSingleObjectEx
771fc29d +0d kernel32.dll               WaitForSingleObject
00794b47 +17 Program.exe      madCodeHook LpcWorkerThread
004bd371 +0d Program.exe      madExcept   CallThreadProcSafe
004bd3db +37 Program.exe      madExcept   ThreadExceptFrame
771fed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1570 at:
771fdcdd +1b kernel32.dll               CreateThread

disassembling:
008cd0e4     public Program.initialization:     ; function entry point
008cd0e4 087   push    ebp
008cd0e5       mov     ebp, esp
008cd0e7       add     esp, -$10
008cd0ea       mov     eax, $8be96c
008cd0ef       call    -$4c0c78 ($40c47c)     ; SysInit.@InitExe
008cd0ef
008cd0f4       xor     eax, eax
008cd0f6       push    ebp
008cd0f7       push    $8cd1df                ; System.@HandleFinally
008cd0fc       push    dword ptr fs:[eax]
008cd0ff       mov     fs:[eax], esp
008cd102 088   call    -$e877 ($8be890)       ; Program.IsAlreadyRunning
008cd102
008cd107       test    al, al
008cd109       jnz     loc_8cd1af
008cd109
008cd10f 108   mov     eax, [$8e6288]
008cd114       mov     eax, [eax]
008cd116       call    -$3266a3 ($5a6a78)     ; Vcl.Forms.TApplication.Initialize
008cd116
008cd11b 109   mov     eax, [$8e6288]
008cd120       mov     eax, [eax]
008cd122       mov     dl, 1
008cd124       call    -$3249b1 ($5a8778)     ; Vcl.Forms.TApplication.SetMainFormOnTaskBar
008cd124
008cd129 110   mov     ecx, [$8e5b04]
008cd12f       mov     eax, [$8e6288]
008cd134       mov     eax, [eax]
008cd136       mov     edx, [$8b42d8]
008cd13c       call    -$3266b1 ($5a6a90)     ; Vcl.Forms.TApplication.CreateForm
008cd13c
008cd141 111   mov     ecx, [$8e6724]
008cd147       mov     eax, [$8e6288]
008cd14c       mov     eax, [eax]
008cd14e       mov     edx, [$8be60c]
008cd154       call    -$3266c9 ($5a6a90)     ; Vcl.Forms.TApplication.CreateForm
008cd154
008cd159 112   mov     ecx, [$8e62bc]
008cd15f       mov     eax, [$8e6288]
008cd164       mov     eax, [eax]
008cd166       mov     edx, [$8b07c0]
008cd16c       call    -$3266e1 ($5a6a90)     ; Vcl.Forms.TApplication.CreateForm
008cd16c
008cd171 113   mov     ecx, [$8e6278]
008cd177       mov     eax, [$8e6288]
008cd17c       mov     eax, [eax]
008cd17e       mov     edx, [$82defc]
008cd184       call    -$3266f9 ($5a6a90)     ; Vcl.Forms.TApplication.CreateForm
008cd184
008cd189 114   mov     ecx, [$8e68c4]
008cd18f       mov     eax, [$8e6288]
008cd194       mov     eax, [eax]
008cd196       mov     edx, [$8b4068]
008cd19c       call    -$326711 ($5a6a90)     ; Vcl.Forms.TApplication.CreateForm
008cd19c
008cd1a1 115   mov     eax, [$8e6288]
008cd1a6       mov     eax, [eax]
008cd1a8     > call    -$3265c5 ($5a6be8)     ; Vcl.Forms.TApplication.Run
008cd1a8
008cd1ad       jmp     loc_8cd1d1
008cd1ad
008cd1ad     ; ---------------------------------------------------------
008cd1ad
008cd1af     loc_8cd1af:
008cd1af 120   push    $10040
008cd1b4       push    $8cd1ec
008cd1b9       push    $8cd1f0
008cd1be       push    0
008cd1c0       call    -$4bae41 ($412384)     ; Winapi.Windows.MessageBox
008cd1c0
008cd1c5 121   mov     eax, [$8e6288]
008cd1ca       mov     eax, [eax]
008cd1cc       call    -$3264c9 ($5a6d08)     ; Vcl.Forms.TApplication.Terminate
008cd1cc
008cd1d1     loc_8cd1d1:
008cd1d1 124   xor     eax, eax
008cd1d3       pop     edx
008cd1d4       pop     ecx
008cd1d5       pop     ecx
008cd1d6       mov     fs:[eax], edx
008cd1d9       push    $8cd1e6                ; System.@Halt0
008cd1d6
008cd1de     loc_8cd1de:
008cd1de       ret
008cd1de
008cd1de     ; ---------------------------------------------------------
008cd1de
008cd1df       jmp     -$4c6164 ($407080)     ; System.@HandleFinally
008cd1df
008cd1e4       jmp     loc_8cd1de
008cd1e4
008cd1e4     ; ---------------------------------------------------------
008cd1e4
008cd1e6       call    -$4c59b3 ($407838)     ; System.@Halt0
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

It seems weird to have a frozen reported with that main thread callstack. Anyway, one "solution" would be to disable the freeze check in the madExcept settings. Of course you'd lose the freeze check functionality that way...
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

If I recall correctly, after i click "Continue application", my program try to execute its self and there will be alert "..app already running" because I use mutex to prevent multiple instances. The program is still running but losing its functionality (could not create new thread etc). The only solution right now is restart the program.

Disabling the freeze check option only makes me kill my program with Task Manager because the way to close my program is I have to click popup menu on notification area/taskbar which is popup menu won't show its menu because of this bug.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

I'm not sure if you think that this is a bug in madExcept and madExcept is causing all these problems? If that's true, simply disabling the freeze check in the madExcept settings should "fix" the problem. However, what you're describing sounds more like a problem in your program to me, which is just properly detected and reported by madExcept. The only thing that confuses me a bit is the callstack.
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

No, I'm sure this is a bug from my program.
madshi wrote:which is just properly detected and reported by madExcept. The only thing that confuses me a bit is the callstack
That's why I asked about this :? It seems my problem is same with problem at viewtopic.php?=&p=11387

In that link you said "So my suggestion is to add logging to all your initialization parts to find out where it's stuck."

Did u mean "initialization parts" is like:

Code: Select all

unit UnitName:
....
initialization
 {initialization code goes here}
finalization
 {finalization code goes here}
end.
Thanks in advance.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

Well, that thread you're linking to has a callback which makes sense, though. The callstack there clearly indicates that the process is stuck in one of the initialization sections. Your callstack doesn't look like that, so I'm not sure what to suggest. Also you say the problem occurs "sometimes". How often is "sometimes"? And does the occur during the start of your process? Or during the closing? Or in the middle of the runtime?
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

The problem often occurs after program ran in a few hours, so the occur is in the middle of the runtime. My program works in background and it stays on tray icon. It use timer, IPC, MCHook. I don't really understand about frozen app, the only thing that I know frozen can happen if a program/thread being not responding or race condition in timer.

Here's another frozen report from my other program (I've remove some part of report). This report show that ActiveX.CoCreateInstance cause the problem, right? Actually most of my customers send me frozen reports that occurred in initialization but I am lucky because this report show frozen report in a function. I don't know, maybe this report can be a reference for suggesting me .

Code: Select all

callstack crc     : $f9c9340f, $4c46054e, $079dcb95
exception number  : 1
exception message : The application seems to be frozen.

main thread ($858):
75fcee0c +002b RPCRT4.dll                        NdrPointerMarshall
76025742 +0133 RPCRT4.dll                        NdrClientCall2
75bb98a8 +3628 ole32.dll                         ObjectStublessClient6
75bc9d81 +0033 ole32.dll                         CoCreateInstanceEx
75bc9d3a +002f ole32.dll                         CoCreateInstance
0067ee95 +0089 Program.exe    uMain        713 +19 TMainForm.GetXXX
00605051 +0099 Program.exe    uQuery 661 +23 TForm2.TimerQuery
00493863 +000f Program.exe    ExtCtrls             TTimer.Timer
00493747 +002b Program.exe    ExtCtrls             TTimer.WndProc
004788b4 +0014 Program.exe    Classes              StdWndProc
75a22e3c +000a USER32.dll                        DispatchMessageA
004c71fc +00fc Program.exe    Forms                TApplication.ProcessMessage
004c721e +000a Program.exe    Forms                TApplication.ProcessMessages
00690cc0 +018c Program.exe    uMain       8111 +27 TMainForm.ShellEvent
004d37a2 +0056 Program.exe    madShell             DoCallback
004d3920 +0174 Program.exe    madShell             ProcessEvent
004d3f05 +0049 Program.exe    madShell             TShellEventContainer.ShMsgHandlerProc
004159e0 +0168 Program.exe    madTools             MsgHandlerWindowProc
75a2557d +0044 USER32.dll                        SendMessageW
77236feb +002b ntdll.dll                         KiUserCallbackDispatcher
7610ed6a +0010 kernel32.dll                      BaseThreadInitThunk

thread $10c8 (zzzzzz):
77236a22 +0a ntdll.dll                      NtWaitForSingleObject
75561796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
7610c2ee +3e kernel32.dll                   WaitForSingleObjectEx
7610c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_Timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
7610ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by main thread ($858) at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $10cc (TWndProc): <suspended>
00405754 +50 Program.exe System 46 +0 BeginThread

thread $110c:
77236a02 +0a ntdll.dll     NtWaitForMultipleObjects
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $111c:
77236422 +0a ntdll.dll                NtReplyWaitReceivePort
005b9b10 +30 Program.exe    madCodeHook LpcPortThread
00455385 +0d Program.exe    madExcept   CallThreadProcSafe
004553ef +37 Program.exe    madExcept   ThreadExceptFrame
7610ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $1118 at:
7610dcdd +1b kernel32.dll             CreateThread

thread $1120: <priority:1>
77236a22 +0a ntdll.dll                  NtWaitForSingleObject
75561796 +66 KERNELBASE.dll             WaitForSingleObjectEx
7610c2ee +3e kernel32.dll               WaitForSingleObjectEx
7610c29d +0d kernel32.dll               WaitForSingleObject
005b9792 +12 Program.exe      madCodeHook LpcDispatchThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
7610ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1118 at:
7610dcdd +1b kernel32.dll               CreateThread

thread $1128 (TTimerThread):
77236a22 +0a ntdll.dll                      NtWaitForSingleObject
75561796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
7610c2ee +3e kernel32.dll                   WaitForSingleObjectEx
7610c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_Timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
7610ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by main thread ($858) at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $1200:
77236a22 +0a ntdll.dll                NtWaitForSingleObject
75561796 +66 KERNELBASE.dll           WaitForSingleObjectEx
7610c2ee +3e kernel32.dll             WaitForSingleObjectEx
00455385 +0d Program.exe      madExcept CallThreadProcSafe
004553ef +37 Program.exe      madExcept ThreadExceptFrame
7610ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $10f8 at:
7610dcdd +1b kernel32.dll             CreateThread

thread $1210:
772357d2 +0a ntdll.dll                NtDelayExecution
75561870 +4f KERNELBASE.dll           SleepEx
75561813 +0a KERNELBASE.dll           Sleep
00455385 +0d Program.exe      madExcept CallThreadProcSafe
004553ef +37 Program.exe      madExcept ThreadExceptFrame
7610ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $1204 at:
7610dcdd +1b kernel32.dll             CreateThread

thread $125c (Txxxx):
77236a22 +0a ntdll.dll                                 NtWaitForSingleObject
75561796 +66 KERNELBASE.dll                            WaitForSingleObjectEx
7610c2ee +3e kernel32.dll                              WaitForSingleObjectEx
7610c29d +0d kernel32.dll                              WaitForSingleObject
0067d665 +15 Program.exe      unitRegMon 90 +5 TRegMon.Execute
004554a3 +2b Program.exe      madExcept                  HookedTThreadExecute
00477140 +34 Program.exe      Classes                    ThreadProc
004056f4 +28 Program.exe      System               46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept                  CallThreadProcSafe
004553ef +37 Program.exe      madExcept                  ThreadExceptFrame
7610ed6a +10 kernel32.dll                              BaseThreadInitThunk
>> created by main thread ($858) at:
00405754 +50 Program.exe      System               46 +0 BeginThread

thread $1260 (Txxxx):
77236a22 +0a ntdll.dll                                 NtWaitForSingleObject
75561796 +66 KERNELBASE.dll                            WaitForSingleObjectEx
7610c2ee +3e kernel32.dll                              WaitForSingleObjectEx
7610c29d +0d kernel32.dll                              WaitForSingleObject
0067d665 +15 Program.exe      unitRegMon 90 +5 TRegMon.Execute
004554a3 +2b Program.exe      madExcept                  HookedTThreadExecute
00477140 +34 Program.exe      Classes                    ThreadProc
004056f4 +28 Program.exe      System               46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept                  CallThreadProcSafe
004553ef +37 Program.exe      madExcept                  ThreadExceptFrame
7610ed6a +10 kernel32.dll                              BaseThreadInitThunk
>> created by main thread ($858) at:
00405754 +50 Program.exe      System               46 +0 BeginThread

thread $1268:
77236a02 +000a ntdll.dll                NtWaitForMultipleObjects
75566a30 +0000 KERNELBASE.dll           WaitForMultipleObjectsEx
7610bd19 +0089 kernel32.dll             WaitForMultipleObjectsEx
75a262f3 +7f8a USER32.dll               MsgWaitForMultipleObjectsEx
75a237f2 +001a USER32.dll               MsgWaitForMultipleObjects
00455385 +000d Program.exe      madExcept CallThreadProcSafe
004553ef +0037 Program.exe      madExcept ThreadExceptFrame
7610ed6a +0010 kernel32.dll             BaseThreadInitThunk
>> created by thread $1258 at:
7610dcdd +001b kernel32.dll             CreateThread

thread $14b8:
77236422 +0a ntdll.dll                NtReplyWaitReceivePort
005b9b10 +30 Program.exe    madCodeHook LpcPortThread
00455385 +0d Program.exe    madExcept   CallThreadProcSafe
004553ef +37 Program.exe    madExcept   ThreadExceptFrame
7610ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $1258 at:
7610dcdd +1b kernel32.dll             CreateThread

thread $14bc: <priority:1>
77236a22 +0a ntdll.dll                  NtWaitForSingleObject
75561796 +66 KERNELBASE.dll             WaitForSingleObjectEx
7610c2ee +3e kernel32.dll               WaitForSingleObjectEx
7610c29d +0d kernel32.dll               WaitForSingleObject
005b9792 +12 Program.exe      madCodeHook LpcDispatchThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
7610ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1258 at:
7610dcdd +1b kernel32.dll               CreateThread

thread $14c0 (TTimerThread):
77236a22 +0a ntdll.dll                      NtWaitForSingleObject
75561796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
7610c2ee +3e kernel32.dll                   WaitForSingleObjectEx
7610c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_Timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
7610ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by thread $1258 at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $121c:
77236a22 +0a ntdll.dll                  NtWaitForSingleObject
75561796 +66 KERNELBASE.dll             WaitForSingleObjectEx
7610c2ee +3e kernel32.dll               WaitForSingleObjectEx
7610c29d +0d kernel32.dll               WaitForSingleObject
005b96db +17 Program.exe      madCodeHook LpcWorkerThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
7610ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1120 at:
7610dcdd +1b kernel32.dll               CreateThread

thread $141c:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $14cc:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $11b8:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $a74:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $13cc:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $11e8:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $930:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $1030:
77236a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
7610ed6a +10 kernel32.dll  BaseThreadInitThunk


disassembling:
0067ee0c     public TMainForm.GetXXX:  ; function entry point
0067ee0c 694   push    ebp
0067ee0d       mov     ebp, esp
0067ee0f       mov     ecx, $2b
0067ee0d
0067ee14     loc_67ee14:
0067ee14       push    0
0067ee16       push    0
0067ee18       dec     ecx
0067ee19       jnz     loc_67ee14
0067ee19
0067ee1b       push    ecx
0067ee1c       push    ebx
0067ee1d       push    esi
0067ee1e       push    edi
0067ee1f       mov     [ebp-$28], eax
0067ee22       xor     eax, eax
0067ee24       push    ebp
0067ee25       push    $67f3a4                ; System.@HandleFinally
0067ee2a       push    dword ptr fs:[eax]
0067ee2d       mov     fs:[eax], esp
0067ee30 695   cmp     byte ptr [$6a57e8], 0
0067ee37       jz      loc_67f343
0067ee37
0067ee3d 697   mov     byte ptr [$6a57e8], 0
0067ee44 698   xor     edx, edx
0067ee46       push    ebp
0067ee47       push    $67f33c                ; System.@HandleFinally
0067ee4c       push    dword ptr fs:[edx]
0067ee4f       mov     fs:[edx], esp
0067ee52 709   call    -$275e03 ($409054)     ; Windows.GetForegroundWindow
0067ee52
0067ee57       mov     [ebp-$2c], eax
0067ee5a 710   mov     eax, [ebp-$28]
0067ee5d       mov     byte ptr [eax+$534], 0
0067ee64 711   mov     eax, [ebp-$28]
0067ee67       mov     byte ptr [eax+$639], 0
0067ee6e 712   xor     edx, edx
0067ee70       push    ebp
0067ee71       push    $67f31d                ; System.@HandleAnyException
0067ee76       push    dword ptr fs:[edx]
0067ee79       mov     fs:[edx], esp
0067ee7c 713   lea     eax, [ebp-4]
0067ee7f       call    -$277648 ($40783c)     ; System.@IntfClear
0067ee7f
0067ee84       push    eax
0067ee85       mov     eax, [$6a6588]
0067ee8a       push    eax
0067ee8b       push    7
0067ee8d       push    0
0067ee8f       mov     eax, [$6a6138]
0067ee94       push    eax
0067ee95     > call    -$250b42 ($42e358)     ; ActiveX.CoCreateInstance
0067ee95
0067ee9a       test    eax, $80000000
0067ee9f       setz    al
0067eea2       test    al, al
0067eea4       jz      loc_67f313
0067eea4
0067eeaa 715   xor     edx, edx
0067eeac       push    ebp
0067eead       push    $67f30c                ; System.@HandleFinally
0067eeb2       push    dword ptr fs:[edx]
0067eeb5       mov     fs:[edx], esp
0067eeb8 716   lea     eax, [ebp-$14c]
0067eebe       push    eax
0067eebf       mov     eax, [ebp-4]
0067eec2       push    eax
0067eec3       mov     eax, [eax]
0067eec5       call    dword ptr [eax+$1c]
0067eec5
0067eec8       call    -$277581 ($40794c)     ; System.@CheckAutoResult
0067eec8
0067eecd       mov     eax, [ebp-$14c]
0067eed3       dec     eax
0067eed4       test    eax, eax
0067eed6       jl      loc_67f2f6
0067eed6
0067eedc       inc     eax
0067eedd       mov     [ebp-$40], eax
0067eee0       mov     dword ptr [ebp-$30], 0
0067eedd
0067eee7     loc_67eee7:
0067eee7 718   lea     eax, [ebp-8]
0067eeea       call    -$2776b3 ($40783c)     ; System.@IntfClear
0067eeea
0067eeef       push    eax
0067eef0       lea     eax, [ebp-$15c]
0067eef6       mov     edx, [ebp-$30]
0067eef9       mov     cl, $fc
0067eefb       call    -$21702c ($467ed4)     ; Variants.@OleVarFromInt
0067eefb
0067ef00       push    dword ptr [ebp-$150]
0067ef06       push    dword ptr [ebp-$154]
0067ef0c       push    dword ptr [ebp-$158]
0067ef12       push    dword ptr [ebp-$15c]
0067ef18       mov     eax, [ebp-4]
0067ef1b       push    eax
0067ef1c       mov     eax, [eax]
0067ef1e       call    dword ptr [eax+$20]
0067ef1e
0067ef21       call    -$2775da ($40794c)     ; System.@CheckAutoResult
0067ef21
0067ef26 719   xor     edx, edx
0067ef28       push    ebp
0067ef29       push    $67f2e3                ; System.@HandleFinally
0067ef2e       push    dword ptr fs:[edx]
0067ef31       mov     fs:[edx], esp
0067ef34 720   lea     eax, [ebp-$c]
0067ef37       call    -$277700 ($40783c)     ; System.@IntfClear
0067ef37
0067ef3c       push    eax
0067ef3d       mov     eax, [$6a58e8]
0067ef42       push    eax
0067ef43       mov     eax, [ebp-8]
0067ef46       push    eax
0067ef47       mov     eax, [eax]
0067ef49       call    dword ptr [eax]
0067ef49
0067ef4b       test    eax, $80000000
0067ef50       setz    al
0067ef53       test    al, al
0067ef55       jz      loc_67f2cd
0067ef55
0067ef5b 721   xor     edx, edx
0067ef5d       push    ebp
0067ef5e       push    $67f2c6                ; System.@HandleFinally
0067ef63       push    dword ptr fs:[edx]
0067ef66       mov     fs:[edx], esp
0067ef69 722   lea     eax, [ebp-$14c]
0067ef6f       push    eax
0067ef70       mov     eax, [ebp-$c]
0067ef73       push    eax
0067ef74       mov     eax, [eax]
0067ef76       call    dword ptr [eax+$94]
0067ef76
0067ef7c       call    -$277635 ($40794c)     ; System.@CheckAutoResult
0067ef7c
0067ef81       mov     eax, [ebp-$14c]
0067ef87       cdq
0067ef88       push    edx
0067ef89       push    eax
0067ef8a       mov     eax, [ebp-$2c]
0067ef8d       xor     edx, edx
0067ef8f       cmp     edx, [esp+4]
0067ef93       jnz     loc_67ef98
0067ef93
0067ef95       cmp     eax, [esp]
0067ef93
0067ef98     loc_67ef98:
0067ef98       pop     edx
0067ef99       pop     eax
0067ef9a       jnz     loc_67f2b0
0067ef9a
0067efa0 724   lea     eax, [ebp-$10]
0067efa3       call    -$27776c ($40783c)     ; System.@IntfClear
0067efa3
0067efa8       push    eax
0067efa9       push    $67f3b4
0067efae       mov     eax, [ebp-$c]
0067efb1       push    eax
0067efb2       mov     eax, [eax]
0067efb4       call    dword ptr [eax]
0067efb4
0067efb6       test    eax, $80000000
0067efbb       setz    al
0067efbe       test    al, al
0067efc0       jz      loc_67f2a4
0067efc0
0067efc6 726   xor     edx, edx
0067efc8       push    ebp
0067efc9       push    $67f29d                ; System.@HandleFinally
0067efce       push    dword ptr fs:[edx]
0067efd1       mov     fs:[edx], esp
0067efd4 727   lea     eax, [ebp-$14]
0067efd7       call    -$2777a0 ($40783c)     ; System.@IntfClear
0067efd7
0067efdc       push    eax
0067efdd       mov     eax, [$6a59cc]
0067efe2       push    eax
0067efe3       mov     eax, [$6a5e98]
0067efe8       push    eax
0067efe9       mov     eax, [ebp-$10]
0067efec       push    eax
0067efed       mov     eax, [eax]
0067efef       call    dword ptr [eax+$c]
0067efef
0067eff2       test    eax, $80000000
0067eff7       setz    al
0067effa       test    al, al
0067effc       jz      loc_67f287
0067effc
0067f002 729   xor     edx, edx
0067f004       push    ebp
0067f005       push    $67f280                ; System.@HandleFinally
0067f00a       push    dword ptr fs:[edx]
0067f00d       mov     fs:[edx], esp
0067f010 730   lea     eax, [ebp-$18]
0067f013       call    -$2777dc ($40783c)     ; System.@IntfClear
0067f013
0067f018       push    eax
0067f019       mov     eax, [ebp-$14]
0067f01c       push    eax
0067f01d       mov     eax, [eax]
0067f01f       call    dword ptr [eax+$3c]
0067f01f
0067f022       test    eax, $80000000
0067f027       setz    al
0067f02a       test    al, al
0067f02c       jz      loc_67f26a
0067f02c
0067f032 731   xor     edx, edx
0067f034       push    ebp
0067f035       push    $67f263                ; System.@HandleFinally
0067f03a       push    dword ptr fs:[edx]
0067f03d       mov     fs:[edx], esp
0067f040 732   lea     eax, [ebp-$1c]
0067f043       call    -$27780c ($40783c)     ; System.@IntfClear
0067f043
0067f048       push    eax
0067f049       mov     eax, [$6a5a94]
0067f04e       push    eax
0067f04f       mov     eax, [ebp-$18]
0067f052       push    eax
0067f053       mov     eax, [eax]
0067f055       call    dword ptr [eax]
0067f055
0067f057       test    eax, $80000000
0067f05c       setz    al
0067f05f       test    al, al
0067f061       jz      loc_67f24d
0067f061
0067f067 734   xor     edx, edx
0067f069       push    ebp
0067f06a       push    $67f246                ; System.@HandleFinally
0067f06f       push    dword ptr fs:[edx]
0067f072       mov     fs:[edx], esp
0067f075 735   lea     eax, [ebp-$20]
0067f078       call    -$277841 ($40783c)     ; System.@IntfClear
0067f078
0067f07d       push    eax
0067f07e       push    $67f3c4
0067f083       mov     eax, [ebp-$1c]
0067f086       push    eax
0067f087       mov     eax, [eax]
0067f089       call    dword ptr [eax+$14]
0067f089
0067f08c       test    eax, $80000000
0067f091       setz    al
0067f094       test    al, al
0067f096       jz      loc_67f230
0067f096
0067f09c 737   xor     edx, edx
0067f09e       push    ebp
0067f09f       push    $67f229                ; System.@HandleFinally
0067f0a4       push    dword ptr fs:[edx]
0067f0a7       mov     fs:[edx], esp
0067f0aa 738   lea     eax, [ebp-$34]
0067f0ad       push    eax
0067f0ae       mov     eax, [ebp-$20]
0067f0b1       push    eax
0067f0b2       mov     eax, [eax]
0067f0b4       call    dword ptr [eax+$14]
0067f0b4
0067f0b7       test    eax, $80000000
0067f0bc       setz    al
0067f0bf       test    al, al
0067f0c1       jz      loc_67f213
0067f0c1
0067f0c7 740   xor     edx, edx
0067f0c9       push    ebp
0067f0ca       push    $67f20c                ; System.@HandleFinally
0067f0cf       push    dword ptr fs:[edx]
0067f0d2       mov     fs:[edx], esp
0067f0d5 741   mov     eax, [ebp-$28]
0067f0d8       add     eax, $534
0067f0dd       push    eax
0067f0de       mov     eax, [ebp-$34]
0067f0e1       push    eax
0067f0e2       call    -$7d9db ($60170c)      ; JwaShlObj.SHGetPathFromIDList
0067f0e2
0067f0e7       test    eax, eax
0067f0e9       jnz     loc_67f0fd
0067f0e9
0067f0eb 743   mov     edx, $67f3d4
0067f0f0       mov     eax, [ebp-$28]
0067f0f3       add     eax, $534
0067f0f8       call    -$22330d ($45bdf0)     ; SysUtils.StrCopy
0067f0f8
0067f0fd     loc_67f0fd:
0067f0fd 744   lea     eax, [ebp-$38]
0067f100       push    eax
0067f101       mov     eax, [ebp-$1c]
0067f104       push    eax
0067f105       mov     eax, [eax]
0067f107       call    dword ptr [eax+$28]
0067f107
0067f10a       test    eax, $80000000
0067f10f       setz    al
0067f112       test    al, al
0067f114       jz      loc_67f1f5
0067f114
0067f11a 747   lea     eax, [ebp-$3c]
0067f11d       push    eax
0067f11e       mov     eax, [ebp-$38]
0067f121       push    eax
0067f122       mov     eax, [ebp-$1c]
0067f125       push    eax
0067f126       mov     eax, [eax]
0067f128       call    dword ptr [eax+$18]
0067f128
0067f12b       test    eax, $80000000
0067f130       setz    al
0067f133       test    al, al
0067f135       jz      loc_67f1f5
0067f135
0067f13b 749   xor     edx, edx
0067f13d       push    ebp
0067f13e       push    $67f1ee                ; System.@HandleFinally
0067f143       push    dword ptr fs:[edx]
0067f146       mov     fs:[edx], esp
0067f149 750   lea     eax, [ebp-$24]
0067f14c       call    -$277915 ($40783c)     ; System.@IntfClear
0067f14c
0067f151       push    eax
0067f152       mov     eax, [$6a58bc]
0067f157       push    eax
0067f158       mov     eax, [ebp-$20]
0067f15b       push    eax
0067f15c       mov     eax, [eax]
0067f15e       call    dword ptr [eax]
0067f15e
0067f160       test    eax, $80000000
0067f165       setz    al
0067f168       test    al, al
0067f16a       jz      loc_67f1d7
0067f16a
0067f16c 753   xor     edx, edx
0067f16e       push    ebp
0067f16f       push    $67f1d0                ; System.@HandleFinally
0067f174       push    dword ptr fs:[edx]
0067f177       mov     fs:[edx], esp
0067f17a 754   lea     eax, [ebp-$148]
0067f180       push    eax
0067f181       push    1
0067f183       mov     eax, [ebp-$3c]
0067f186       push    eax
0067f187       mov     eax, [ebp-$24]
0067f18a       push    eax
0067f18b       mov     eax, [eax]
0067f18d       call    dword ptr [eax+$2c]
0067f18d
0067f190       test    eax, $80000000
0067f195       setz    al
0067f198       test    al, al
0067f19a       jz      loc_67f1ba
0067f19a
0067f19c 757   push    $104
0067f1a1       mov     eax, [ebp-$28]
0067f1a4       add     eax, $639
0067f1a9       push    eax
0067f1aa       mov     eax, [ebp-$3c]
0067f1ad       push    eax
0067f1ae       lea     eax, [ebp-$148]
0067f1b4       push    eax
0067f1b5       call    -$7da9e ($60171c)      ; unitGetXXX.StrRetToBuf
0067f1b5
0067f1ba     loc_67f1ba:
0067f1ba       xor     eax, eax
0067f1bc       pop     edx
0067f1bd       pop     ecx
0067f1be       pop     ecx
0067f1bf       mov     fs:[eax], edx
0067f1c2       push    $67f1d7
0067f1bf
0067f1c7     loc_67f1c7:
0067f1c7 760   lea     eax, [ebp-$24]
0067f1ca       call    -$277993 ($40783c)     ; System.@IntfClear
0067f1ca
0067f1cf       ret
0067f1cf
0067f1cf     ; ---------------------------------------------------------
0067f1cf
0067f1d0       jmp     -$27a285 ($404f50)     ; System.@HandleFinally
0067f1d0
0067f1d5       jmp     loc_67f1c7
0067f1d5
0067f1d5     ; ---------------------------------------------------------
0067f1d5
0067f1d7     loc_67f1d7:
0067f1d7       xor     eax, eax
0067f1d9       pop     edx
0067f1da       pop     ecx
0067f1db       pop     ecx
0067f1dc       mov     fs:[eax], edx
0067f1df       push    $67f1f5
0067f1dc
0067f1e4     loc_67f1e4:
0067f1e4 763   mov     eax, [ebp-$3c]
0067f1e7       push    eax
0067f1e8       call    -$250e6d ($42e380)     ; ActiveX.CoTaskMemFree
0067f1e8
0067f1ed       ret
0067f1ed
0067f1ed     ; ---------------------------------------------------------
0067f1ed
0067f1ee       jmp     -$27a2a3 ($404f50)     ; System.@HandleFinally
0067f1ee
0067f1f3       jmp     loc_67f1e4
0067f1f3
0067f1f3     ; ---------------------------------------------------------
0067f1f3
0067f1f5     loc_67f1f5:
0067f1f5       xor     eax, eax
0067f1f7       pop     edx
0067f1f8       pop     ecx
0067f1f9       pop     ecx
0067f1fa       mov     fs:[eax], edx
0067f1fd       push    $67f213
0067f1fa
0067f202     loc_67f202:
0067f202 767   mov     eax, [ebp-$34]
0067f205       push    eax
0067f206       call    -$250e8b ($42e380)     ; ActiveX.CoTaskMemFree
0067f206
0067f20b       ret
0067f20b
0067f20b     ; ---------------------------------------------------------
0067f20b
0067f20c       jmp     -$27a2c1 ($404f50)     ; System.@HandleFinally
0067f20c
0067f211       jmp     loc_67f202
0067f211
0067f211     ; ---------------------------------------------------------
0067f211
0067f213     loc_67f213:
0067f213       xor     eax, eax
0067f215       pop     edx
0067f216       pop     ecx
0067f217       pop     ecx
0067f218       mov     fs:[eax], edx
0067f21b       push    $67f230
0067f218
0067f220     loc_67f220:
0067f220 770   lea     eax, [ebp-$20]
0067f223       call    -$2779ec ($40783c)     ; System.@IntfClear
0067f223
0067f228       ret
0067f228
0067f228     ; ---------------------------------------------------------
0067f228
0067f229       jmp     -$27a2de ($404f50)     ; System.@HandleFinally
0067f229
0067f22e       jmp     loc_67f220
0067f22e
0067f22e     ; ---------------------------------------------------------
0067f22e
0067f230     loc_67f230:
0067f230       xor     eax, eax
0067f232       pop     edx
0067f233       pop     ecx
0067f234       pop     ecx
0067f235       mov     fs:[eax], edx
0067f238       push    $67f24d
0067f235
0067f23d     loc_67f23d:
0067f23d 773   lea     eax, [ebp-$1c]
0067f240       call    -$277a09 ($40783c)     ; System.@IntfClear
0067f240
0067f245       ret
0067f245
0067f245     ; ---------------------------------------------------------
0067f245
0067f246       jmp     -$27a2fb ($404f50)     ; System.@HandleFinally
0067f246
0067f24b       jmp     loc_67f23d
0067f24b
0067f24b     ; ---------------------------------------------------------
0067f24b
0067f24d     loc_67f24d:
0067f24d       xor     eax, eax
0067f24f       pop     edx
0067f250       pop     ecx
0067f251       pop     ecx
0067f252       mov     fs:[eax], edx
0067f255       push    $67f26a
0067f252
0067f25a     loc_67f25a:
0067f25a 776   lea     eax, [ebp-$18]
0067f25d       call    -$277a26 ($40783c)     ; System.@IntfClear
0067f25d
0067f262       ret
0067f262
0067f262     ; ---------------------------------------------------------
0067f262
0067f263       jmp     -$27a318 ($404f50)     ; System.@HandleFinally
0067f263
0067f268       jmp     loc_67f25a
0067f268
0067f268     ; ---------------------------------------------------------
0067f268
0067f26a     loc_67f26a:
0067f26a       xor     eax, eax
0067f26c       pop     edx
0067f26d       pop     ecx
0067f26e       pop     ecx
0067f26f       mov     fs:[eax], edx
0067f272       push    $67f287
0067f26f
0067f277     loc_67f277:
0067f277 779   lea     eax, [ebp-$14]
0067f27a       call    -$277a43 ($40783c)     ; System.@IntfClear
0067f27a
0067f27f       ret
0067f27f
0067f27f     ; ---------------------------------------------------------
0067f27f
0067f280       jmp     -$27a335 ($404f50)     ; System.@HandleFinally
0067f280
0067f285       jmp     loc_67f277
0067f285
0067f285     ; ---------------------------------------------------------
0067f285
0067f287     loc_67f287:
0067f287       xor     eax, eax
0067f289       pop     edx
0067f28a       pop     ecx
0067f28b       pop     ecx
0067f28c       mov     fs:[eax], edx
0067f28f       push    $67f2a4                ; System.@TryFinallyExit
0067f28c
0067f294     loc_67f294:
0067f294 782   lea     eax, [ebp-$10]
0067f297       call    -$277a60 ($40783c)     ; System.@IntfClear
0067f297
0067f29c       ret
0067f29c
0067f29c     ; ---------------------------------------------------------
0067f29c
0067f29d       jmp     -$27a352 ($404f50)     ; System.@HandleFinally
0067f29d
0067f2a2       jmp     loc_67f294
0067f2a2
0067f2a2     ; ---------------------------------------------------------
0067f2a2
0067f2a4     loc_67f2a4:
0067f2a4 784   call    -$27a109 ($4051a0)     ; System.@TryFinallyExit
0067f2a4
0067f2a9       call    -$27a10e ($4051a0)     ; System.@TryFinallyExit
0067f2a9
0067f2ae       jmp     loc_67f2f6
0067f2ae
0067f2ae     ; ---------------------------------------------------------
0067f2ae
[...]

madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

If madExcept says that your program is "frozen", that practically means that your main thread has not been reacting to messages for a long time.

If your customers send your frozen reports in initialization, then the callstack of their reports may be helpful. For that specific problem the suggestions from the other thread you linked might help you, too. But it's all so much more difficult if you can't reliably reproduce the initialization freeze on your development PC.

Code: Select all

exception message : The application seems to be frozen.

main thread ($858):
75fcee0c +002b RPCRT4.dll                        NdrPointerMarshall
76025742 +0133 RPCRT4.dll                        NdrClientCall2
75bb98a8 +3628 ole32.dll                         ObjectStublessClient6
75bc9d81 +0033 ole32.dll                         CoCreateInstanceEx
75bc9d3a +002f ole32.dll                         CoCreateInstance
0067ee95 +0089 Program.exe    uMain        713 +19 TMainForm.GetXXX
00605051 +0099 Program.exe    uQuery 661 +23 TForm2.TimerQuery
00493863 +000f Program.exe    ExtCtrls             TTimer.Timer
00493747 +002b Program.exe    ExtCtrls             TTimer.WndProc
004788b4 +0014 Program.exe    Classes              StdWndProc
75a22e3c +000a USER32.dll                        DispatchMessageA
004c71fc +00fc Program.exe    Forms                TApplication.ProcessMessage
004c721e +000a Program.exe    Forms                TApplication.ProcessMessages
00690cc0 +018c Program.exe    uMain       8111 +27 TMainForm.ShellEvent
004d37a2 +0056 Program.exe    madShell             DoCallback
004d3920 +0174 Program.exe    madShell             ProcessEvent
004d3f05 +0049 Program.exe    madShell             TShellEventContainer.ShMsgHandlerProc
004159e0 +0168 Program.exe    madTools             MsgHandlerWindowProc
75a2557d +0044 USER32.dll                        SendMessageW
77236feb +002b ntdll.dll                         KiUserCallbackDispatcher
7610ed6a +0010 kernel32.dll                      BaseThreadInitThunk
What does TMainForm.GetXXX in line 713 do? Does it create some OLE/COM object?
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

TMainForm.GetXXX contain function that create some OLE/COM/ShellWindows object. This function is called by timer in uQuery 661 +23 TForm2.TimerQuery.

If the code in timer is stack, it can produces frozen because timer run in main thread?

Here is another example frozen in initialization from my past project, the report always like this:

Code: Select all

callstack crc     : $d2389088, $bbf6b422, $a0be680c
exception number  : 1
exception message : The application seems to be frozen.

main thread ($a2c):
762166c7 +00a USER32.dll                 WaitMessage
004c7e71 +12d Program.exe    Forms         TApplication.Idle
004c7243 +017 Program.exe    Forms         TApplication.HandleMessage
004c7547 +0b3 Program.exe    Forms         TApplication.Run
0069430d +1c9 Program.exe    Program 224 +79 initialization
75e5ed6a +010 kernel32.dll               BaseThreadInitThunk

thread $eb0 (TTimerThread):
774c6a22 +0a ntdll.dll                      NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll                   WaitForSingleObjectEx
75e5c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
75e5ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by main thread ($a2c) at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $500 (TWndProc): <suspended>
00405754 +50 Program.exe System 46 +0 BeginThread

thread $d2c:
774c6a02 +0a ntdll.dll     NtWaitForMultipleObjects
75e5ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $1004:
774c6422 +0a ntdll.dll                NtReplyWaitReceivePort
005b9b10 +30 Program.exe    madCodeHook LpcPortThread
00455385 +0d Program.exe    madExcept   CallThreadProcSafe
004553ef +37 Program.exe    madExcept   ThreadExceptFrame
75e5ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $504 at:
75e5dcdd +1b kernel32.dll             CreateThread

thread $1008: <priority:1>
774c6a22 +0a ntdll.dll                  NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll               WaitForSingleObjectEx
75e5c29d +0d kernel32.dll               WaitForSingleObject
005b9792 +12 Program.exe      madCodeHook LpcDispatchThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
75e5ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $504 at:
75e5dcdd +1b kernel32.dll               CreateThread

thread $1024 (TTimerThread):
774c6a22 +0a ntdll.dll                      NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll                   WaitForSingleObjectEx
75e5c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
75e5ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by main thread ($a2c) at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $1074:
774c6a22 +0a ntdll.dll                NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll           WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll             WaitForSingleObjectEx
00455385 +0d Program.exe      madExcept CallThreadProcSafe
004553ef +37 Program.exe      madExcept ThreadExceptFrame
75e5ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $b34 at:
75e5dcdd +1b kernel32.dll             CreateThread


thread $10ac:
774c6a02 +000a ntdll.dll                NtWaitForMultipleObjects
758d6a30 +0000 KERNELBASE.dll           WaitForMultipleObjectsEx
75e5bd19 +0089 kernel32.dll             WaitForMultipleObjectsEx
762162f3 +7f8a USER32.dll               MsgWaitForMultipleObjectsEx
762137f2 +001a USER32.dll               MsgWaitForMultipleObjects
00455385 +000d Program.exe      madExcept CallThreadProcSafe
004553ef +0037 Program.exe      madExcept ThreadExceptFrame
75e5ed6a +0010 kernel32.dll             BaseThreadInitThunk
>> created by thread $109c at:
75e5dcdd +001b kernel32.dll             CreateThread

thread $12d0:
774c6422 +0a ntdll.dll                NtReplyWaitReceivePort
005b9b10 +30 Program.exe    madCodeHook LpcPortThread
00455385 +0d Program.exe    madExcept   CallThreadProcSafe
004553ef +37 Program.exe    madExcept   ThreadExceptFrame
75e5ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $109c at:
75e5dcdd +1b kernel32.dll             CreateThread

thread $12d4: <priority:1>
774c6a22 +0a ntdll.dll                  NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll               WaitForSingleObjectEx
75e5c29d +0d kernel32.dll               WaitForSingleObject
005b9792 +12 Program.exe      madCodeHook LpcDispatchThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
75e5ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $109c at:
75e5dcdd +1b kernel32.dll               CreateThread

thread $12d8 (TTimerThread):
774c6a22 +0a ntdll.dll                      NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll                 WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll                   WaitForSingleObjectEx
75e5c29d +0d kernel32.dll                   WaitForSingleObject
004d484b +13 Program.exe      u_timer 95 +3 TTimerThread.Execute
004554a3 +2b Program.exe      madExcept       HookedTThreadExecute
00477140 +34 Program.exe      Classes         ThreadProc
004056f4 +28 Program.exe      System    46 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept       CallThreadProcSafe
004553ef +37 Program.exe      madExcept       ThreadExceptFrame
75e5ed6a +10 kernel32.dll                   BaseThreadInitThunk
>> created by thread $109c at:
00405754 +50 Program.exe      System    46 +0 BeginThread

thread $12e4:
774c57d2 +0a ntdll.dll                NtDelayExecution
758d1870 +4f KERNELBASE.dll           SleepEx
758d1813 +0a KERNELBASE.dll           Sleep
00455385 +0d Program.exe      madExcept CallThreadProcSafe
004553ef +37 Program.exe      madExcept ThreadExceptFrame
75e5ed6a +10 kernel32.dll             BaseThreadInitThunk
>> created by main thread ($a2c) at:
75e5dcdd +1b kernel32.dll             CreateThread

thread $1348:
774c6a22 +0a ntdll.dll                  NtWaitForSingleObject
758d1796 +66 KERNELBASE.dll             WaitForSingleObjectEx
75e5c2ee +3e kernel32.dll               WaitForSingleObjectEx
75e5c29d +0d kernel32.dll               WaitForSingleObject
005b96db +17 Program.exe      madCodeHook LpcWorkerThread
00455385 +0d Program.exe      madExcept   CallThreadProcSafe
004553ef +37 Program.exe      madExcept   ThreadExceptFrame
75e5ed6a +10 kernel32.dll               BaseThreadInitThunk
>> created by thread $1008 at:
75e5dcdd +1b kernel32.dll               CreateThread

thread $1350:
774c6a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
75e5ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $14bc:
774c6a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
75e5ed6a +10 kernel32.dll  BaseThreadInitThunk

thread $c1c:
774c6a32 +0a ntdll.dll     NtWaitForWorkViaWorkerFactory
75e5ed6a +10 kernel32.dll  BaseThreadInitThunk

disassembling:
00694144     public Program.initialization:     ; function entry point
00694144 145   push    ebp
00694145       mov     ebp, esp
00694147       add     esp, -$1c
0069414a       push    ebx
0069414b       push    esi
0069414c       xor     eax, eax
0069414e       mov     [ebp-$1c], eax
00694151       mov     [ebp-$18], eax
00694154       mov     [ebp-$14], eax
00694157       mov     eax, $6911d0
0069415c       call    -$28c28d ($407ed4)     ; SysInit.@InitExe
0069415c
00694161       mov     esi, [$6a6118]
00694167       xor     eax, eax
00694169       push    ebp
0069416a       push    $6943ba                ; System.@HandleFinally
0069416f       push    dword ptr fs:[eax]
00694172       mov     fs:[eax], esp
00694175 147   call    -$30c6 ($6910b4)       ; Program.IsAlreadyRunning
00694175
0069417a       test    al, al
0069417c       jnz     loc_694382
0069417c
00694182 151   lea     edx, [ebp-$14]
00694185       xor     eax, eax
00694187       call    -$290d00 ($40348c)     ; System.ParamStr
00694187
0069418c       mov     eax, [ebp-$14]
0069418f       call    -$ca854 ($5c9940)      ; uChecksum.IsValidChecksum
0069418f
00694194       test    al, al
00694196       jnz     loc_6941b3
00694196
00694198 153   push    $40030
0069419d       push    $6943c8                ; 'Error:'
006941a2       push    $6943d0                ; 'File damaged!'
006941a7       push    0
006941a9       call    -$28aeea ($4092c4)     ; Windows.MessageBox
006941a9
006941ae 154   jmp     loc_69439f
006941ae
006941ae     ; ---------------------------------------------------------
006941ae
006941b3     loc_6941b3:
006941b3 157   call    -$3104 ($6910b4)       ; Program.IsAlreadyRunning
006941b3
006941b8 172   push    $694464
006941bd       push    1
006941bf       push    0
006941c1       push    0
006941c3       call    -$28be1c ($4083ac)     ; Windows.CreateSemaphore
006941c3
006941c8       mov     ebx, eax
006941ca 179   call    -$3053 ($69117c)       ; Program.UpTime
006941ca
006941cf       cmp     eax, 2
006941d2       jge     loc_6941e6
006941d2
006941d4     loc_6941d4:
006941d4 182   push    $7d0
006941d9       call    -$232752 ($461a8c)     ; SysUtils.Sleep
006941d9
006941de 183   call    -$3067 ($69117c)       ; Program.UpTime
006941de
006941e3       dec     eax
006941e4       jl      loc_6941d4
006941e4
006941e6     loc_6941e6:
006941e6 187   mov     ecx, [esi]
006941e8       mov     dl, 1
006941ea       mov     eax, [$60cb78]
006941ef       call    -$1d66b8 ($4bdb3c)     ; Forms.TCustomForm.Create
006941ef
006941f4       mov     edx, [$6a5f14]
006941fa       mov     [edx], eax
006941fc 188   mov     eax, [$6a5f14]
00694201       mov     eax, [eax]
00694203       call    -$1d0bdc ($4c362c)     ; Forms.TCustomForm.Show
00694203
00694208 189   mov     eax, [$6a5f14]
0069420d       mov     eax, [eax]
0069420f       mov     edx, [eax]
00694211       call    dword ptr [edx+$8c]
00694211
00694217 191   mov     eax, [esi]
00694219       call    -$1ccef6 ($4c7328)     ; Forms.TApplication.Initialize
00694219
0069421e 192   mov     eax, [esi]
00694220       xor     edx, edx
00694222       call    -$1cd447 ($4c6de0)     ; Forms.TApplication.SetTitle
00694222
00694227 193   mov     eax, [esi]
00694229       xor     edx, edx
0069422b       call    -$1cb014 ($4c921c)     ; Forms.TApplicationHelper.SetMainFormOnTaskBar
0069422b
00694230 194   mov     ecx, [$6a655c]
00694236       mov     eax, [esi]
00694238       mov     edx, [$67dd9c]
0069423e       call    -$1ccf03 ($4c7340)     ; Forms.TApplication.CreateForm
0069423e
00694243 195   push    0
00694245       mov     eax, [$6a655c]
0069424a       mov     eax, [eax]
0069424c       call    -$1e4225 ($4b002c)     ; Controls.TWinControl.GetHandle
0069424c
00694251       push    eax
00694252       call    -$28ad8b ($4094cc)     ; Windows.ShowWindow
00694252
00694257 196   mov     ecx, [$6a5ff8]
0069425d       mov     eax, [esi]
0069425f       mov     edx, [$602e64]
00694265       call    -$1ccf2a ($4c7340)     ; Forms.TApplication.CreateForm
00694265
0069426a 199   mov     eax, [$6a5ff8]
0069426f       mov     eax, [eax]
00694271       mov     dl, 1
00694273       call    -$1d3c04 ($4c0674)     ; Forms.TCustomForm.SetWindowState
00694273
00694278 200   mov     eax, [$6a5ff8]
0069427d       mov     eax, [eax]
0069427f       call    -$1d0c58 ($4c362c)     ; Forms.TCustomForm.Show
0069427f
00694284 201   push    0
00694286       mov     eax, [$6a5ff8]
0069428b       mov     eax, [eax]
0069428d       call    -$1e4266 ($4b002c)     ; Controls.TWinControl.GetHandle
0069428d
00694292       push    eax
00694293       call    -$28adcc ($4094cc)     ; Windows.ShowWindow
00694293
00694298 202   mov     ecx, [$6a60c0]
0069429e       mov     eax, [esi]
006942a0       mov     edx, [$5fb0f4]
006942a6       call    -$1ccf6b ($4c7340)     ; Forms.TApplication.CreateForm
006942a6
006942ab 204   push    0
006942ad       mov     eax, [$6a60c0]
006942b2       mov     eax, [eax]
006942b4       call    -$1e428d ($4b002c)     ; Controls.TWinControl.GetHandle
006942b4
006942b9       push    eax
006942ba       call    -$28adf3 ($4094cc)     ; Windows.ShowWindow
006942ba
006942bf 209   mov     ecx, [$6a59f0]
006942c5       mov     eax, [esi]
006942c7       mov     edx, [$602a6c]
006942cd       call    -$1ccf92 ($4c7340)     ; Forms.TApplication.CreateForm
006942cd
006942d2 210   mov     ecx, [$6a6424]
006942d8       mov     eax, [esi]
006942da       mov     edx, [$60956c]
006942e0       call    -$1ccfa5 ($4c7340)     ; Forms.TApplication.CreateForm
006942e0
006942e5 211   mov     ecx, [$6a6518]
006942eb       mov     eax, [esi]
006942ed       mov     edx, [$5f9ac4]
006942f3       call    -$1ccfb8 ($4c7340)     ; Forms.TApplication.CreateForm
006942f3
006942f8 212   mov     ecx, [$6a5aa8]
006942fe       mov     eax, [esi]
00694300       mov     edx, [$66c000]
00694306       call    -$1ccfcb ($4c7340)     ; Forms.TApplication.CreateForm
00694306
0069430b 224   mov     eax, [esi]
0069430d     > call    -$1cce7e ($4c7494)     ; Forms.TApplication.Run
0069430d
00694312 226   push    ebx
00694313       call    -$28c0a4 ($408274)     ; Windows.CloseHandle
00694313
00694318 227   mov     eax, [$6fef70]
0069431d       push    eax
0069431e       call    -$28c0af ($408274)     ; Windows.CloseHandle
0069431e
00694323 228   mov     eax, [$6a621c]
00694328       cmp     byte ptr [eax], 0
0069432b       jz      loc_69439f
0069432b
0069432d 231   call    -$2c1d6 ($66815c)      ; uUtils.GetOperatingSystem
0069432d
00694332       cmp     al, 9
00694334       jz      loc_69433f
00694334
00694336       call    -$2c1df ($66815c)      ; uUtils.GetOperatingSystem
00694336
0069433b       cmp     al, $a
0069433d       jnz     loc_694358
0069433d
0069433f     loc_69433f:
0069433f 232   lea     edx, [ebp-$18]
00694342       xor     eax, eax
00694344       call    -$290ebd ($40348c)     ; System.ParamStr
00694344
00694349       mov     eax, [ebp-$18]
0069434c       mov     edx, $694478
00694351       call    -$29996 ($66a9c0)      ; uUtils.RunAsAdmin
00694351
00694356       jmp     loc_69439f
00694356
00694356     ; ---------------------------------------------------------
00694356
00694358     loc_694358:
00694358 234   push    1
0069435a       push    0
0069435c       push    $694484
00694361       lea     edx, [ebp-$1c]
00694364       xor     eax, eax
00694366       call    -$290edf ($40348c)     ; System.ParamStr
00694366
0069436b       mov     eax, [ebp-$1c]
0069436e       call    -$28e747 ($405c2c)     ; System.@LStrToPChar
0069436e
00694373       push    eax
00694374       push    $694490                ; 'open'
00694379       push    0
0069437b       call    -$266334 ($42e04c)     ; ShellAPI.ShellExecute
0069437b
00694380       jmp     loc_69439f
00694380
00694380     ; ---------------------------------------------------------
00694380
00694382     loc_694382:
00694382 245   push    $40030
00694387       push    $694498
0069438c       push    $69449c                ; 'Program is already running'
00694391       push    0
00694393       call    -$28b0d4 ($4092c4)     ; Windows.MessageBox
00694393
00694398 246   mov     eax, [esi]
0069439a       call    -$1cce03 ($4c759c)     ; Forms.TApplication.Terminate
0069439a
0069439f     loc_69439f:
0069439f 249   xor     eax, eax
006943a1       pop     edx
006943a2       pop     ecx
006943a3       pop     ecx
006943a4       mov     fs:[eax], edx
006943a7       push    $6943c1
006943a4
006943ac     loc_6943ac:
006943ac       lea     eax, [ebp-$1c]
006943af       mov     edx, 3
006943b4       call    -$28ec15 ($4057a4)     ; System.@LStrArrayClr
006943b4
006943b9       ret
006943b9
006943b9     ; ---------------------------------------------------------
006943b9
006943ba       jmp     -$28f46f ($404f50)     ; System.@HandleFinally
006943ba
006943bf       jmp     loc_6943ac
006943bf
006943bf     ; ---------------------------------------------------------
006943bf
006943c1       pop     esi
006943c2       pop     ebx
006943c3       call    -$28ee10 ($4055b8)     ; System.@Halt0
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

The callstack of your first and last bug report do not indicate that the freezing was during initialization.

Yes, if a timer event freezes during COM/OLE creation then the main thread is "frozen", because the main thread does not handle messages, anymore.

I'd suggest that you create a secondary thread which does those OLE/COM/ShellWindows stuff. Instead of using a timer, you can just use an endless loop and "Sleep(someMilliseconds)". This way if the OLE/COM creation freezes, your main thread will still live on. Maybe you can even add a Timer event to the main thread which just checks whether the OLE/COM secondary thread is still alive and if not, maybe gracefully restart the process or something like that.
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

madshi wrote:The callstack of your first and last bug report do not indicate that the freezing was during initialization.
For my last bug report, so in which part the freezing was occur? I think this is my last question for this thread.

Okay madshi, I will follow your suggestion to create a secondary thread. Thanks a lot. :greenBalloon:
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

The callstack indicates that the freeze happened in the middle of the application lifetime, after initialization was complete.
ira
Posts: 49
Joined: Mon Dec 14, 2009 6:29 am

Re: The application seems to be frozen in initialization

Post by ira »

madshi wrote:The callstack indicates that the freeze happened in the middle of the application lifetime, after initialization was complete.
How to "read" the callstack ? I mean how do you know that "The callstack indicates that the freeze happened in the middle of the application lifetime". I don't want to ask you again and again about reading bug report so please explain it shortly to me . Sorry Madshi, I have not read your MadExcept documentation about callstack (perhaps I will read tomorrow).

btw, I create a secondary thread which does those OLE/COM/ShellWindows stuff. Problem still occurs. It means the problem does not relate with those stuff right?

Code: Select all

callstack crc     : $d2389088, $bbf6b422, $455eaa5b
exception number  : 1
exception message : The application seems to be frozen.

main thread ($94c):
761166c7 +00a USER32.dll                 WaitMessage
004c7e71 +12d Program.exe    Forms         TApplication.Idle
004c7243 +017 Program.exe    Forms         TApplication.HandleMessage
004c7547 +0b3 Program.exe    Forms         TApplication.Run
0069b315 +1c9 Program.exe    Program 226 +79 initialization
7706ed6a +010 kernel32.dll               BaseThreadInitThunk

thread $1288 (TMyVirTimer):
76f157d2 +0a ntdll.dll                           NtDelayExecution
75231870 +4f KERNELBASE.dll                      SleepEx
75231813 +0a KERNELBASE.dll                      Sleep
0062647d +21 Program.exe      uGetXXX  266 +9 TMyVirTimer.Execute
004554a3 +2b Program.exe      madExcept            HookedTThreadExecute
00477140 +34 Program.exe      Classes              ThreadProc
004056f4 +28 Program.exe      System        201 +0 ThreadWrapper
00455385 +0d Program.exe      madExcept            CallThreadProcSafe
004553ef +37 Program.exe      madExcept            ThreadExceptFrame
7706ed6a +10 kernel32.dll                        BaseThreadInitThunk
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: The application seems to be frozen in initialization

Post by madshi »

ira wrote:how do you know that "The callstack indicates that the freeze happened in the middle of the application lifetime".
There's "Application.Run" in the callstack. Basically that means that all unit initialization sections were already full executed, because Application.Run is in the "being ... end" block of the dpr file which is only executed after all unit initialization blocks are done.
ira wrote:btw, I create a secondary thread which does those OLE/COM/ShellWindows stuff. Problem still occurs. It means the problem does not relate with those stuff right?
No. The secondary thread should help avoiding this problem:

Code: Select all

callstack crc     : $f9c9340f, $4c46054e, $079dcb95
exception number  : 1
exception message : The application seems to be frozen.

main thread ($858):
75fcee0c +002b RPCRT4.dll                        NdrPointerMarshall
76025742 +0133 RPCRT4.dll                        NdrClientCall2
75bb98a8 +3628 ole32.dll                         ObjectStublessClient6
75bc9d81 +0033 ole32.dll                         CoCreateInstanceEx
75bc9d3a +002f ole32.dll                         CoCreateInstance
0067ee95 +0089 Program.exe    uMain        713 +19 TMainForm.GetXXX
00605051 +0099 Program.exe    uQuery 661 +23 TForm2.TimerQuery
00493863 +000f Program.exe    ExtCtrls             TTimer.Timer
00493747 +002b Program.exe    ExtCtrls             TTimer.WndProc
004788b4 +0014 Program.exe    Classes              StdWndProc
75a22e3c +000a USER32.dll                        DispatchMessageA
004c71fc +00fc Program.exe    Forms                TApplication.ProcessMessage
004c721e +000a Program.exe    Forms                TApplication.ProcessMessages
00690cc0 +018c Program.exe    uMain       8111 +27 TMainForm.ShellEvent
004d37a2 +0056 Program.exe    madShell             DoCallback
004d3920 +0174 Program.exe    madShell             ProcessEvent
004d3f05 +0049 Program.exe    madShell             TShellEventContainer.ShMsgHandlerProc
004159e0 +0168 Program.exe    madTools             MsgHandlerWindowProc
75a2557d +0044 USER32.dll                        SendMessageW
77236feb +002b ntdll.dll                         KiUserCallbackDispatcher
7610ed6a +0010 kernel32.dll                      BaseThreadInitThunk
But it will not help with this one:

Code: Select all

callstack crc     : $d2389088, $bbf6b422, $455eaa5b
exception number  : 1
exception message : The application seems to be frozen.

main thread ($94c):
761166c7 +00a USER32.dll                 WaitMessage
004c7e71 +12d Program.exe    Forms         TApplication.Idle
004c7243 +017 Program.exe    Forms         TApplication.HandleMessage
004c7547 +0b3 Program.exe    Forms         TApplication.Run
0069b315 +1c9 Program.exe    Program 226 +79 initialization
7706ed6a +010 kernel32.dll               BaseThreadInitThunk
These are 2 different problems.
Post Reply