473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2083
"Jim McGrail" <ji****@attbi.c om> wrote in message
news:iq******** ************@rw crnsc51.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
TextWriterTrace Listener 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.c om> wrote in message
news:iq******** ************@rw crnsc51.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***********@s urfcontrol.com
Jul 21 '05 #3

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

Similar topics

3
2971
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 supposed to be reported on the printer but I have commented those pieces of code and have got those records printed on the screen. I am using Microsoft Visual C++ 6.0 on Microsoft XP (Home) platform. I am facing some problems in getting desire...
92
9842
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 someone helps me... Urgent - Please reply soon ! Thanks, Raghu
29
4383
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 process. Is it correct?
4
1737
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 communicate between the threads. The problem is that the program infrequently terminates with no indication of why it terminated.
8
1881
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
6885
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 Enter a number : 30 More numbers (y/n)? n
73
2783
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
2311
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
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.