2

I have a Delphi 2007 application which has been working fine on most machines & Windows versions but now is exhibiting the following behavior 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.

The above happens sporadically for most customers but always occurs for one customer (who runs Windows 10; the other customers are Windows 7 & 8)--so this customer cannot run the application at all (they were running it just fine until recently).

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.

Because the problem is only on remote users' machines, I cannot step through it with the debugger. What's the best way to try to debug this?

I would like to add PeekMessage(), etc., calls in the message loop and output those via CodeSite to see if I can find what message results in the hang, but don't know how to get that done since Application.Run is in the Forms.pas system VCL source.

I'd appreciate any ideas.

Mark Wilsdorf
  • 751
  • 1
  • 5
  • 18
  • 1
    Add madExcept and use madTraceProcess to get a stack trace when the process is hung. Don't forget to buy madExcept. – David Heffernan Nov 04 '15 at 15:53
  • I have madExcept but had never used madTraceProcess. I'll give it a try. – Mark Wilsdorf Nov 04 '15 at 19:39
  • 1
    As for tracing out what messages get processed, TApplication does have an OnMessage event that you could plug something into that would just send the message data to CodeSite or some other logging device. – 500 - Internal Server Error Nov 04 '15 at 20:57
  • "*Because the problem is only on remote users' machines, I cannot step through it with the debugger.*" - have you considered trying Delphi's [Remote Debugger](http://docwiki.embarcadero.com/RADStudio/en/Overview_of_Remote_Debugging)? – Remy Lebeau Nov 11 '15 at 21:35
  • I had the customer run madTraceProcess32 after the hang, and they got the message "No 32 bit process was found, which uses madExcept". So I checked with Mathias Rauen for ideas. My EXE exports the madTraceProcess function, so he didn't know what else might be going on. Had customer disable AV software, etc.; no change. Suddenly now, the application is working (AV software enabled, and after multiple builds trying to figure this out). I do not know what the customer did to fix it (nor do they). Hope it "holds". @Remy Lebeau - the remote debugger was the next step I would have tried...thanks. – Mark Wilsdorf Nov 12 '15 at 21:19

0 Answers0