473,395 Members | 1,972 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,395 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?
Nov 15 '05 #1
4 1720
"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
Nov 15 '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).

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
Nov 15 '05 #3
"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
Nov 15 '05 #4
"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
Nov 15 '05 #5

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

Similar topics

2
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...
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...
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>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.