Jump to content
Attila Kovacs

64-bit VCL App hangs for an extended period during termination

Recommended Posts

One of my VCL apps is hanging in 64-bit mode at termination for 30+ seconds. Any ideas what could be causing this? I don't have to do much; just starting the app and ending it, or pressing Ctrl+F2. Other apps are terminating instantly. I would prefer to try some tips before resorting to cloning the project and systematically removing components.

 

IDE: Berlin U2

 

Share this post


Link to post

You can use the Nexus Quality Suite (MethodTimer) or a similar product to measure times of things that happen in code and how long they need to find bottlenecks.

Share this post


Link to post
30 minutes ago, Attila Kovacs said:

One of my VCL apps is hanging in 64-bit mode at termination for 30+ seconds. Any ideas what could be causing this? I don't have to do much; just starting the app and ending it, or pressing Ctrl+F2. Other apps are terminating instantly. I would prefer to try some tips before resorting to cloning the project and systematically removing components.

 

IDE: Berlin U2

 

What does the debugger tell you

Share this post


Link to post
7 minutes ago, David Heffernan said:

What does the debugger tell you

it's a 

Syscall( 0x2C, Handle ); // NtTerminateProcess

 in kernel32.dll. I can't debug further, this wait's about 30 secs, then the IDE becomes responsive again.

 

Share this post


Link to post

Do you have the option enabled to scan for memory leaks when it terminates? Or some memory manager that does that itself?

Share this post


Link to post
2 minutes ago, David Schwartz said:

Do you have the option enabled to scan for memory leaks when it terminates? Or some memory manager that does that itself?

I checked that first and found nothing. But it seems to be related to the database connection. So hold on, I'll return if I run out of ideas for troubleshooting.

Share this post


Link to post
2 minutes ago, Attila Kovacs said:

I checked that first and found nothing. But it seems to be related to the database connection. So hold on, I'll return if I run out of ideas for troubleshooting.

I've seen apps hang on disconnecting from DBs. I've never known why, tho. Is there an unterminated transaction that's waiting to time-out, perhaps?

Edited by David Schwartz

Share this post


Link to post
17 minutes ago, David Schwartz said:

Is there an unterminated transaction that's waiting to time-out, perhaps?

no, in 32 bit mode it's all fine

Share this post


Link to post

Can try the various SysInternals tools (Process Monitor and Process Explorer) to see some of what that app is doing. There is also tools like API Monitor to see what Windows API calls (and results) the application is making, Depending on the database and database connection method there are logging tools there as well. 

 

Sysinternals Process Utilities - Sysinternals | Microsoft Learn

API Monitor: Spy on API Calls and COM Interfaces (Freeware 32-bit and 64-bit Versions!) | rohitab.com

 

A long shot would be checking any code that runs during shutdown for IF's that might be coded wrong for 64bit so try to do things they shouldn't like try and open a database connection to a non-existent database server. 

Share this post


Link to post

Not much in Procmon, some TCP communication between bds.exe and dbkw64_24_0.exe, and you can see the delays. The 30-second appears to be a timeout for something. But it's just groping in the dark for now.

 

image.thumb.png.a61c474eec44fdb6b6f5d85a0c8c0eb9.png

 

Share this post


Link to post
3 hours ago, David Heffernan said:

You'd have the answer by now if you'd started stripping stuff out

Yes, but I need to gather strength for that first.

  • Haha 1

Share this post


Link to post

It's the Vcl.FlexCel.Core and FlexCel.XlsAdapter units.

I'll ask the Author.

Edited by Attila Kovacs

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×