473,836 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FATAL:Exception occured when pthread_exit() used

4 New Member
We had written an application in which we create worker thread.



So the main thread will create the worker thread. After some time

the child thread(Worker thread) will call pthread_exit().

This function was written in try{} and there occured an exception
and is handled in catch(...) handler.


This is on Linux platform.

The Implementation of the code is as follows:

This is a simple form of our application, Try to run this small piece

of code.



The output of this is " FATAL: exception not rethrown

Inside catch... Aborted"



#include <stdio.h>

#include <stdlib.h>

#include <stdexcept.h>

#include <pthread.h>



using namespace std;



void print_message_f unction( void *ptr );

int main()

{

pthread_t thread1;

char *message1 = "Thread 1";

int iret1;



iret1 = pthread_create( &thread1, NULL, (void*(*)(void* ))&print_messag e_function, (void*) message1);



pthread_join( thread1, NULL);





}



void print_message_f unction( void *ptr )

{

char *message;

message = (char *) ptr;



try

{

pthread_exit((v oid*) 1);

}

catch(...)

{

printf("Inside catch...\n");

}

}

CAN ANY ONE TELL ME THE REASON WHY EXCEPTION OCCURED?
Nov 29 '07 #1
1 2823
weaknessforcats
9,208 Recognized Expert Moderator Expert
pthread_exit((v oid*) 1);
I'm no Linux expert, but do you really mean to convert 1 to an address??
Nov 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2564
by: Developwebsites | last post by:
A fatal exception 0E has occurred at 0028:C027B6DC in VXD VWIN32(04)+00001088. The current application will be terminated. Same program below run in DOS does not crash. #include<iostream> #include<iomanip> int numb_cities=0;
2
1651
by: Ray Cassick \(Home\) | last post by:
I am running the code for a code assembly through FXCop here and it seems to be throwing a fit each time I pass in some descriptive text into the constructor for various exceptions I am throwing. FXCop says that I should be grabbing the text from a string resource so that it can be localized based on the current culture info. If this was text that was going to be displayed in a GUI that might be used in a different country I might be...
7
1894
by: Jacek Dziedzic | last post by:
Hi! I'm trying to make friends with exceptions. I think I'm doing well, there is one thing that bothers me, however. If an object is declared within a try block, it gets destroyed on exception, because then we're into the catch block and out of the try block, right? How can I sense in the destructor that we're in the middle of processing an exception (and hence take appropriate action, like not destroying the object if some...
1
4021
by: Jarek | last post by:
Hi all! How can I identify the source of this message ? It appeares when application receives SIGINT. Jarek.
4
7090
by: D'artagnan | last post by:
I'm using Pthreads in a C++ program that uses exceptions. When one thread is cancelled (cancellation state is deferred) by the main thread, it throws some mysterious exception which cannot even be caught by "catch(...)". The program aborts with the following error message: FATAL: exception not rethrown Abort
3
3478
by: Miro | last post by:
I cant seem to find an example on how to do something, ( vb2005.express ) i have a Try ListeningSerialPort.Open() TestText.Enabled = True Catch ex As Exception 'Debug.WriteLine(ex.Message) End Try
0
899
by: devinaren | last post by:
When I tried to open the client i.e User interface which is MainMenuApp received NO_PERMISSION CORBA exception while attempting to get an initial reference to the mvcf_ControllerFactory from the FactoryFinder. Software defect that should be addressed is that the UI did not recover after catching the exception and required a restart of the UI to connect. The problem is that cleanWorkspace() in CorbaAdapter doesn't have any failover logic in it...
4
4576
by: leelaprasad.gorrepati | last post by:
We had written an application in which we create worker thread. So the main thread will create the worker thread. After some time the child thread(Worker thread) will call pthread_exit(). This function was written in try{} and there occured an and is handled in catch(...) handler. Can any one tell me the reason why the exception occured. This is on Linux platform.
0
1581
by: platso | last post by:
We had written an application in which we create worker thread. So the main thread will create the worker thread. After some time the child thread(Worker thread) will call pthread_exit(). This function was written in try{} and there occured an exception and is handled in catch(...) handler.
0
9827
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
10862
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...
1
10607
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
10262
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
9389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5838
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4468
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.