public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/784] New: pthread_join causes a segmentation fault when it is called in catch block
@ 2005-03-11  2:38 xogusgalaxy at yahoo dot co dot kr
  2005-03-15  7:50 ` [Bug nptl/784] " jakub at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: xogusgalaxy at yahoo dot co dot kr @ 2005-03-11  2:38 UTC (permalink / raw)
  To: glibc-bugs

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 <pthread.h>

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug nptl/784] pthread_join causes a segmentation fault when it is called in catch block
  2005-03-11  2:38 [Bug nptl/784] New: pthread_join causes a segmentation fault when it is called in catch block xogusgalaxy at yahoo dot co dot kr
@ 2005-03-15  7:50 ` jakub at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jakub at redhat dot com @ 2005-03-15  7:50 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2005-03-15 07:49 -------
Can't reproduce this, with neither current glibc nor with 20030926 one.
Judging from GCC version you are using, you are on Red Hat Linux 9, that's simply
too old.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME


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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-15  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-11  2:38 [Bug nptl/784] New: pthread_join causes a segmentation fault when it is called in catch block xogusgalaxy at yahoo dot co dot kr
2005-03-15  7:50 ` [Bug nptl/784] " jakub at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).