From owner-freebsd-bugs Thu Dec 2 10:20:52 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 1368E14E07 for ; Thu, 2 Dec 1999 10:20:43 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA20961; Thu, 2 Dec 1999 10:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (Postfix) with ESMTP id E6F5214D09 for ; Thu, 2 Dec 1999 10:15:01 -0800 (PST) (envelope-from rcarter@pinyon.org) Received: (from daemon@localhost) by smtp01.primenet.com (8.9.3/8.9.3) id LAA23723 for ; Thu, 2 Dec 1999 11:14:16 -0700 (MST) Received: from ip-83-152.prc.primenet.com(207.218.83.152), claiming to be "pinyon.org" via SMTP by smtp01.primenet.com, id smtpdAAAnsaqST; Thu Dec 2 11:13:46 1999 Received: by pinyon.org (Postfix, from userid 1001) id CCF5456; Thu, 2 Dec 1999 11:13:24 -0700 (MST) Message-Id: <19991202181324.CCF5456@pinyon.org> Date: Thu, 2 Dec 1999 11:13:24 -0700 (MST) From: rcarter@pinyon.org Reply-To: rcarter@pinyon.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: misc/15228: C++ exceptions+threads fail Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 15228 >Category: misc >Synopsis: C++ exceptions+threads SIGABRTs. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 2 10:20:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Russell L. Carter >Release: FreeBSD 4.0-CURRENT i386 >Organization: Conceptual Systems & Software >Environment: standard -current >Description: Throwing a c++ exception across threads causes core dump. >How-To-Repeat: $ c++ -pthread -D_THREAD_SAFE ex_test.cpp $ ./a.out Throwing Ex: Caught Ex, now rethrowing it... Caught Ex thrown from main thread. Throwing Ex: Caught Ex, now rethrowing it... Abort trap (core dumped) $ ex_test.cpp: #include #include class Ex {}; class testEx { public: void throwEx () { fprintf(stderr, "Throwing Ex:\n"); throw Ex (); } }; void * f(void *) { testEx thetest; thetest.throwEx (); } void * g(void *arg) { try { f(arg); } catch (Ex &ex) { fprintf(stderr, "Caught Ex, now rethrowing it...\n"); throw; } } int main (void) { int *arg = 0; try { g((void *) arg); } catch (Ex &ex) { fprintf(stderr, "Caught Ex thrown from main thread.\n"); } pthread_t ex_thread; pthread_attr_t *attr = 0; try { pthread_create(&ex_thread, attr, g, (void *) arg); } catch (Ex &ex) { fprintf(stderr, "Caught Ex thrown from child thread.\n"); } pthread_join(ex_thread, (void **) &arg); return 0; } >Fix: None yet. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message