Attila Kovacs 629 Posted July 19, 2023 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
KodeZwerg 54 Posted July 19, 2023 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
David Heffernan 2347 Posted July 19, 2023 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
Attila Kovacs 629 Posted July 19, 2023 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
David Schwartz 427 Posted July 19, 2023 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
Attila Kovacs 629 Posted July 19, 2023 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
David Schwartz 427 Posted July 19, 2023 (edited) 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 July 19, 2023 by David Schwartz Share this post Link to post
Attila Kovacs 629 Posted July 19, 2023 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
Brian Evans 108 Posted July 20, 2023 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
Attila Kovacs 629 Posted July 20, 2023 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. Share this post Link to post
David Heffernan 2347 Posted July 20, 2023 You'd have the answer by now if you'd started stripping stuff out Share this post Link to post
gkobler 38 Posted July 20, 2023 May some threads there are not terminate immediatly? Share this post Link to post
Attila Kovacs 629 Posted July 20, 2023 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. 1 Share this post Link to post
Attila Kovacs 629 Posted July 20, 2023 (edited) It's the Vcl.FlexCel.Core and FlexCel.XlsAdapter units. I'll ask the Author. Edited July 20, 2023 by Attila Kovacs Share this post Link to post
aehimself 396 Posted August 3, 2023 Try updating your external dependencies. I had the very same issue with an older MySQL driver a while ago. Share this post Link to post