Solved

Strange Hanging Condition

Posted on 2011-09-12
10
293 Views
Last Modified: 2012-05-12
This is a weird one, as I don't think it has anything to do with the code I'm using per se.

I'm in the middle of a very simple Delphi project, it just uses the file open dialog, makes a couple of changes to the file and then saves it.

Recently I started seeing a problem right after the file dialog is called. After the dialog closes (with or without selecting a file), the program hangs for 15-20 seconds. This hang happens while debugging and after creating/running the EXE.

Here's the tricky part. If I move the EXE to another PC, it doesn't hang.

It seems likely that some other program is conflicting with my program, but I'm not sure what it might be since I haven't made any changes recently (that I recall!). Before I go through disabling everything one at a time, I thought I'd check with the experts here.

Have you seen this kind of thing before? Any ideas how I might track down the culprit? I'm assigning a full 500 points, since this one is so weird. Thanks!
0
Comment
Question by:surfbored
  • 6
  • 3
10 Comments
 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
virusscanner ?
how to track ? this has a log of what was scanned.
> check the settings of the virusscanner to find where this log is written and check the contents
McAffee > check environment variable %DEFLOGDIR%
0
 
LVL 25

Expert Comment

by:epasquier
Comment Utility
Yeah, I think I have seen this. But only when running the application from Delphi IDE, and only with recent Delphi (2007 or XE, don't remember which) and never when run normally, so I didn't take that seriously.

Are you sure you have the problem when you run outside Delphi ? Which Delphi version ? Which OS ?
0
 
LVL 25

Expert Comment

by:epasquier
Comment Utility
and yes, it's possible a virus scanner was involved at the time. Can't say for sure it's related, but at the time I saw that problem, I remember changing a few time the virus scanner on my system. I tried AVG, Avira and probably a third one I don't remember. None of those where satisfying IMO, so I went to Avast, and since then I'm happy. But I really haven't make any relationship between Antivirus & that problem.
0
 
LVL 1

Author Comment

by:surfbored
Comment Utility
@Geert Gruwez: Virus scanner was my first thought too, but there isn't anything strange in the logs.

@epasquier: I'm running Delphi XE on Windows XP. I'm sure it happens outside Delphi, but only with this one EXE. I have other projects that use virtually identical code and they do not give the same results.

Thanks for the ideas. Got any more?
0
 
LVL 25

Expert Comment

by:epasquier
Comment Utility
I'm afraid we are already doing guesswork here... that looks like just another fluke like so many others.
God, I love computers and software :o)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 25

Expert Comment

by:epasquier
Comment Utility
that's a long shot, and I found that rarely useful because of the amount of information that it gives, but have you tried ProcessExplorer or ProcessMonitor for MS sysinternals suite ?
http://technet.microsoft.com/fr-fr/sysinternals
0
 
LVL 1

Author Comment

by:surfbored
Comment Utility
I tried using ProcessMonitor in the past and found it difficult to use effectively, but I'll give it a go again if nothing else turns up.

After more trial and error, I discovered something that makes a difference in the results. I have a very large file (300MB) in the same folder as my target files. When I move this file to a different location, the hang goes away!

This seems odd to me, since the large file isn't being used in any way. Perhaps it's a goofy Windows thing? Has anyone else experienced this before?
0
 
LVL 25

Expert Comment

by:epasquier
Comment Utility
yes, with media files, and the windows thumbnail preview feature enabled (doesn't have to be displayed, windows update it anyway)
0
 
LVL 25

Accepted Solution

by:
epasquier earned 500 total points
Comment Utility
Beside, the process to show the thumbnail preview may slow down the file listing process when opening folder with video files. Beside, the preview on no codec or corrupted movie or video clip (i.e. no index from a partial download) may cause system problems such as Windows XP stops responding or freezing with 100% CPU utilization, and prevent users from deleting, renaming or moving the file until the file is completely loaded.

http://www.mydigitallife.info/how-to-enable-or-disable-media-and-video-thumbnail-preview-in-windows-xp/
0
 
LVL 1

Author Closing Comment

by:surfbored
Comment Utility
Just knowing that the problem is not in the code is good enough for me, but you went that extra mile to prove your point. Thanks for sticking it through to the end.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now