Delphi 2007 app hangs in Application.Run

delphi package - automated exception handling
Post Reply
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

I have a Delphi 2007 application which has been working fine on most machines & Windows versions but is now hanging in Application.Run for four customers.

The application briefly flashes a bit of UI(too quickly to read). It doesn't appear to be the entire main window; maybe just a message window, etc.? Then it is no longer visible. The application is not listed on the Applications tab of Task Manager; it has to be killed from the Processes tab.

madExcept never traps an exception.

Unfortunately we cannot duplicate this behavior in house, so I've sent out diagnostic versions of the application liberally instrumented with CodeSite message calls. The CodeSite logs reveal that the application hangs in Application.Run, but none of the mainform's events ever get called (I've instrumented all of them with CodeSite message calls), so the hang must occur very early in message loop processing.

Any idea of a different way to use madExcept to help debug this? (Yes, I'm grasping at straws!)

Thanks.
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

We tried having madExcept check for a frozen main thread...no luck (it never reported the main thread as frozen).
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

We found out that madTraceProcess might be a way to see what was going on, and asked the Windows 10 user to run it after our application hangs.

She got the message "This process seems to use an old version of madExcept." ....which should not be the case, since both are from the same installed version of madExcept.

I'm using madExcept version 2.5.8.0. The madTraceProcess.exe file seems to contain no Fileversion, but is dated 3/10/2008.

I'd be glad to upgrade madExcept if there's a likelihood it would help....the only reason I haven't is that the version I'm using has served well & didn't need to be changed.

Please advise.
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

By the way, using CodeSite I've verified that madExcept *is* getting registered before Application.Run gets called. (Registration happens in the Initialization section of a unit I have which applies custom madExcept settings.)

But could the "...old version of madExcept" message be due to madExcept not being fully initialized before the problem occurs in Application.Run?
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

The saga continues...

I downloaded the current version of madCollection, applied it to my EXE, and ran my application here. madTraceProcess32 works fine to trace that process while running.

Then I sent a test version to the customer. After the EXE starts, she ran madTraceProcess32 and now gets the message "No 32bit process found, which uses madExcept."

Any ideas about what could be going on?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 2007 app hangs in Application.Run

Post by madshi »

Hmmmmm... Can you check whether your EXE file has an export named "madTraceProcess" (you can use the freeware PEBrowse Pro for that)? It should have. Oh well, I guess it MUST have, because otherwise you wouldn't be able to run madTraceProcess on your development PC successfully. However, the madTraceProcess complaints you're reporting do indicate that although madTraceProcess seems to be able to open your process, it doesn't seem to be able to locate this "madTraceProcess" exported function, for some reason.

You don't use EXE compression or protection, do you?

Is it possible that there's some security product (anti-virus etc) running on your end user's PC which blocks access to your EXE somehow? Not sure if that makes sense, though. Are you code signing your EXE file?
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

> You don't use EXE compression or protection, do you?

No. We normally use Armadillo but have disabled that in recent versions we are testing for this customer, to eliminate it as a possibility.

I'll verify the madTraceProcess function export later, and reply back.

Is it possible that something is not fully initialized since the application hangs early in Application.Run?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 2007 app hangs in Application.Run

Post by madshi »

It's really impossible for me to say, with the limited information I have.
FlagshipTech
Posts: 12
Joined: Sun Jan 18, 2009 1:47 am

Re: Delphi 2007 app hangs in Application.Run

Post by FlagshipTech »

After nearly two weeks of trying different things the customer now says our product is suddenly working. I cannot know what they did on their end that fixed the problem...and I hate it when things that were failing suddenly work for no identified reason.

We'll see whether this situation holds or not...I may be replying back if it doesn't.

Thanks for your help.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Delphi 2007 app hangs in Application.Run

Post by madshi »

I suspect some security software (anti-virus or similar) problem that was fixed with a new virus definition database update.
Post Reply