FATAL:exception occured with pthread_exit()


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users FATAL:exception occured with pthread_exit()
# 1  
Old 11-29-2007
FATAL:exception occured with pthread_exit()

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.



Can any one tell me the reason why the exception occured.



This is on Linux platform. Fedora Core 6 and gcc 4.1





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_function( void *ptr );

int main()

{

pthread_t thread1;

char *message1 = "Thread 1";

int iret1;



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



pthread_join( thread1, NULL);





}



void print_message_function( void *ptr )

{

char *message;

message = (char *) ptr;



try

{

pthread_exit((void*) 1);

}

catch(...)

{

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

}

}


Can any one tell me the reason why the exception occured?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

PHP Fatal Errors During SSL Cert Management - PHP Fatal error: xc_fcntl_mutex failed

Today, I noticed some errors in our SSL cert renewal log files, mostly related to domains where the IP address had changed. Concerned about this, rebuilt out SSL cert, which normally goes well without a hiccup. However, for today, for some reason which I cannot explain, there was a PHP error... (0 Replies)
Discussion started by: Neo
0 Replies

2. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies

3. Shell Programming and Scripting

Count events occured in the same second in awk

Hello to all in forum, I need to count how many events happens within each second for 01 Aug 2013.(because in the sample appears records for 01 Aug and 02 Aug). The output for the input below should be: Desired Output: --> 2 Records --> 1 Record --> 3 Records Input: DEBUG... (5 Replies)
Discussion started by: Ophiuchus
5 Replies

4. Programming

pthread_exit query

Hi, I am new to multithreaded programming. When creating a thread to run a specific function, does the function need to have a pthread_exit ? Is pthread_exit analogous to a return in a function? (3 Replies)
Discussion started by: sanjayc
3 Replies

5. Programming

pthread_exit and pthread_join usage

Hi... this simple code has warning messages but it work.. void *th(void *g){ int y = 10; pthread_exit((void*)y); } int main(int argn, char ** argp){ void * ret; pthread_t thread; pthread_create(&thread, NULL, th, NULL); pthread_join(thread,... (10 Replies)
Discussion started by: prompt
10 Replies

6. UNIX for Advanced & Expert Users

Error occured while running a script

Hi All, In my application, I'm getting an error as type mismatch Let me now explain the scenario, I ran a shell script which calls some other scripts. All these scripts uses the environment variables. Take for example, this script uses a variable 'PathDir'. I initiallized the value to... (2 Replies)
Discussion started by: iamgeethuj
2 Replies

7. UNIX Desktop Questions & Answers

kernel panic-not syncing:fatal exception while booting

Hi ALL, I am getting error.. kernal panic-not syncing:fatal exception while booting. Please help me.. Thanks Jack (7 Replies)
Discussion started by: jack00423
7 Replies

8. Programming

Doubt on pthread_exit and pthread_join

Main function creates Thread0 and Thread1 by using pthread_create systemcall. In Thread0() { we are calling pthread_exit(0) ; } and in Thread1() { status= pthread_join(tid,NULL); sprintf(ebuf,"timer6: can't join with thread0, status: %d",status); Assert(status==0,ebuf); } ... (4 Replies)
Discussion started by: mansa
4 Replies

9. UNIX for Advanced & Expert Users

Kernel panic : Fatal exception

HI, My Machine is running on RHEL3, Its not booting. When I try to boot in rescue mode.Its giving the following err: " Kernel panic : Fatal exception " Can any one tel me how to get rid of this error? (3 Replies)
Discussion started by: praveen_b744
3 Replies

10. UNIX for Dummies Questions & Answers

finding no of counts the words occured

hi, cud u help me to find this. i hav 2 files. file1 has data as "ARUN ARUN is from Australia Arun likes America etc.. ARUN ARUN " file2 has "ARUN Australia America" i... (5 Replies)
Discussion started by: arunsubbhian
5 Replies
Login or Register to Ask a Question