Hang of application that reads xml with .NET

G

gws

We have an application that consists of a Delphi executable and some .NET
assemblies. Delphi uses the .NET assemblies through COM. In one of the .NET
asseblies a xml file will be read for database connection settings.

In some cases the read action of the xml hangs. It doesn't raise an
exception, it hangs. After that we kill the process and restart the
application and it hangs again.
With a porcess explorer we saw that the xml file can be read and was read
well, but after that it seems to hang in the .NET (i.e. MSXML) xml parser.

We've tried to reïnstall .NET (2.0 SP1) and that works, but the problems
popups after one or two days again.

Does anybody recognize this or this kind of problems? And does anybody know
a solution or any hint to get a solution?
 
J

Jani Järvinen [MVP]

Hello!
We have an application that consists of a Delphi executable and some .NET
assemblies. Delphi uses the .NET assemblies through COM.
...
In some cases the read action of the xml hangs. It doesn't raise an
exception, it hangs. After that we kill the process and restart the
application and it hangs again.

If we can assume that your application hangs only from time to time, then it
sounds like the parsing process is either stuck in a loop, or is waiting for
something to happen, which never will. Without knowledge about the code in
the .NET asemply doing the parsing, it is difficult to say why it hangs.
This could be caused by file locks, networking issues, or even security
settings on the machine.

Does this hanging occur on one machine only, or can you repeat the situation
on multiple computers? If you haven't tried on multiple machines, I suggest
that you try your application on another computer.

Also, have you checked with for example Windows Task Manager whether the
application uses 100% of the CPU time when it hangs, or is it just idling?
You might also wish to try breaking into the process with Delphi's debugger
to get an idea what code the DLL is executing at the time of hanging.

--
Regards,

Jani Järvinen
C# MVP
Vantaa, Finland
(e-mail address removed)
 
G

gws

Thank you Jani for your reply. Several things you suggest I already tried. On
a couple of machines in our company this problem occurs. On others it works
normal. If the application hangs then the CPU time is 0% for the process, so
it is idle. We just discovered that the problem can solved till the next
logon/reboot if we repair .NET 2.0 SP1. With a file monitor tool we are able
to see that the file will be read OK, but after that it hangs in the parser
of .NET and not in our code.

We already exclude almost everything from the Delphi executable until we
only have the read action of the xml. That also hangs. The same call to read
xml from a C++ application (so we replace the Delphi executable by a C++
executable) succeeds. Also a pure .Net application can read/parse the xml.
Why do only the Delphi application hang? Is this about multi threading or
multi core CPU's?

regards,

Krijn Brak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top