From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16379 invoked by alias); 11 Mar 2005 02:38:14 -0000 Mailing-List: contact glibc-bugs-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sources.redhat.com Received: (qmail 16314 invoked by uid 48); 11 Mar 2005 02:38:11 -0000 Date: Fri, 11 Mar 2005 02:38:00 -0000 From: "xogusgalaxy at yahoo dot co dot kr" To: glibc-bugs@sources.redhat.com Message-ID: <20050311023809.784.xogusgalaxy@yahoo.co.kr> Reply-To: sourceware-bugzilla@sources.redhat.com Subject: [Bug nptl/784] New: pthread_join causes a segmentation fault when it is called in catch block X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg00041.txt.bz2 List-Id: I've found the pthread_join() function seems to cause a segmentation fault when one thread throws an exception and the other thread waits for its termination in its own catch block. This is a simple source code. #include void* thread1(void* arg) { try { /* Throw an exception and terminate this thread.*/ throw 1; } catch (...) { } } int main(int argc, char* argv[]) { pthread_t tid = 0; try { pthread_create(&tid, NULL, thread1, 0); throw 1; // Throw an exception } catch (...) { /* Wait for child thread's termination in catch block. */ if (tid) pthread_join(tid, NULL); // This causes segmentation fault. } return 0; } Here is my g++ version that compiled the source code. gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Backtrace of core file: #0 0x400aed0f in __cxa_end_catch () from /usr/lib/libstdc++.so.5 #1 0x080486d2 in main (argc=1, argv=0xbfffda74) at main.cpp:19 <-- pthread_join #2 0x42015504 in __libc_start_main () from /lib/tls/libc.so.6 -- Summary: pthread_join causes a segmentation fault when it is called in catch block Product: glibc Version: unspecified Status: NEW Severity: critical Priority: P1 Component: nptl AssignedTo: drepper at redhat dot com ReportedBy: xogusgalaxy at yahoo dot co dot kr CC: glibc-bugs at sources dot redhat dot com http://sources.redhat.com/bugzilla/show_bug.cgi?id=784 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.