473,668 Members | 2,330 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 2809
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
2549
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
1643
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
1885
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
4012
by: Jarek | last post by:
Hi all! How can I identify the source of this message ? It appeares when application receives SIGINT. Jarek.
4
7064
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
3465
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
892
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
4563
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
1574
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
8459
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
8890
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
8791
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...
0
8653
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...
1
6206
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
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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.