473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Infrequent program termination

Background:

I am investigating a problem involving a windows .NET application that is
being developed in C# with Visual Studio 2003.

It is a multi-threaded application that uses MSMQ to communicate between the
threads.

The problem is that the program infrequently terminates with no indication
of why it terminated.

There are no exceptions thrown and it happens very infrequently (1 in 300
executions).

The termination appears to be caused by an interaction of events and cannot
be recreated (doing the same actions will not cause the termination).

Questions:

Can a program terminate with no indication of what caused the termination
(no exception thrown)?

Could this be caused by thread blocking / waiting? (This doesn't seem
likely)

Could this be caused by thread deadlock? (This doesn't seem likely either)

Does anyone have any experiences similar to this one?
Jul 21 '05 #1
2 2061
"Jim McGrail" <ji****@attbi.com> wrote in message
news:iq********************@rwcrnsc51.ops.asp.att. net...
Background:

I am investigating a problem involving a windows .NET application that is
being developed in C# with Visual Studio 2003.

It is a multi-threaded application that uses MSMQ to communicate between the threads.

The problem is that the program infrequently terminates with no indication
of why it terminated.

There are no exceptions thrown and it happens very infrequently (1 in 300
executions).

The termination appears to be caused by an interaction of events and cannot be recreated (doing the same actions will not cause the termination).

Questions:

Can a program terminate with no indication of what caused the termination
(no exception thrown)?

Could this be caused by thread blocking / waiting? (This doesn't seem
likely)

Could this be caused by thread deadlock? (This doesn't seem likely either)

Does anyone have any experiences similar to this one?


Hi Jim,

Multi-threaded apps are a bear (er...I mean fun) to debug aren't they. :)

The best way I've found for tracking down multi-threaded problems is to use
Tracing, writing the output to a log file and then examining where each
thread is at specified points in time and other information pertinent to the
problem. Relevant information for each Trace write includes the Thread
name, Type/Method, and DateTime along with other specific information.

Although the DateTimes may not be perfectly accurate, they are approximate
and can help you see what is happening on each thread. Here's the docs on
TextWriterTraceListener for an example of how to get this started:

http://msdn.microsoft.com/library/de...classtopic.asp

Joe
--
http://www.csharp-station.com
Jul 21 '05 #2
"Jim McGrail" <ji****@attbi.com> wrote in message
news:iq********************@rwcrnsc51.ops.asp.att. net...
Background:

I am investigating a problem involving a windows .NET application that is
being developed in C# with Visual Studio 2003.

It is a multi-threaded application that uses MSMQ to communicate between the threads.

The problem is that the program infrequently terminates with no indication
of why it terminated.

There are no exceptions thrown and it happens very infrequently (1 in 300
executions).


If I were you, I'd make completely sure that there are no exceptions thrown.
Make sure you have a try block around the code of _every_ thread and also
around the code of any thread pool work items.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
92
by: Raghavendra R A V, CSS India | last post by:
hie.. Do any one knows how to write a C program without using the conditional statements if, for, while, do, switch, goto and even condotional statements ? It would be a great help for me if...
29
by: keredil | last post by:
Hi, Will the memory allocated by malloc get released when program exits? I guess it will since when the program exits, the OS will free all the memory (global, stack, heap) used by this...
4
by: Jim McGrail | last post by:
Background: I am investigating a problem involving a windows .NET application that is being developed in C# with Visual Studio 2003. It is a multi-threaded application that uses MSMQ to...
8
by: Scorpio | last post by:
Hi all, I found the simple program below, no error, no warning. But it can work with no output. Does anyone know why? int main() { 0; }
9
by: ehabaziz2001 | last post by:
I am facing that error message with no idea WHY the reason ? "Abnormal program termination" E:\programs\c_lang\iti01\tc201\ch06\ownarr01o01 Enter a number : 25 More numbers (y/n)? y...
73
by: Rajeet Dalawal | last post by:
Good day group. I was asked in an interview to explain the behavior of this program. void main() { char *s = "abc"; int *i = (int *) s; printf("%x", *i); }
4
by: Goran | last post by:
Hi all, i have a problem on program termination. At the moment when main() ends my program creates a segmentation fault. #include <libmylib/myObject.h>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.