From owner-freebsd-i386@FreeBSD.ORG Tue Oct 21 10:30:01 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7C810656AA for ; Tue, 21 Oct 2008 10:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DC2048FC35 for ; Tue, 21 Oct 2008 10:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LAU0xD039660 for ; Tue, 21 Oct 2008 10:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id m9LAU0vX039657; Tue, 21 Oct 2008 10:30:00 GMT (envelope-from gnats) Resent-Date: Tue, 21 Oct 2008 10:30:00 GMT Resent-Message-Id: <200810211030.m9LAU0vX039657@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dmitry Moskalchuk Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29D8E106567B for ; Tue, 21 Oct 2008 10:26:21 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 189C38FC13 for ; Tue, 21 Oct 2008 10:26:21 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LAQK8Q046168 for ; Tue, 21 Oct 2008 10:26:20 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id m9LAQKER046167; Tue, 21 Oct 2008 10:26:20 GMT (envelope-from nobody) Message-Id: <200810211026.m9LAQKER046167@www.freebsd.org> Date: Tue, 21 Oct 2008 10:26:20 GMT From: Dmitry Moskalchuk To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: i386/128265: deadlock in pthread_create occurs in case if any C++ exception was thrown and succesfully catched X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 10:30:01 -0000 >Number: 128265 >Category: i386 >Synopsis: deadlock in pthread_create occurs in case if any C++ exception was thrown and succesfully catched >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 21 10:30:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Dmitry Moskalchuk >Release: 7.0-STABLE >Organization: DrWeb >Environment: FreeBSD freebsd70s.i.drweb.ru 7.0-STABLE FreeBSD 7.0-STABLE #0: Fri Aug 22 22:54:27 MSD 2008 root@freebsd70s.i.drweb.ru:/usr/obj/usr/src/sys/GENERIC i386 >Description: There is an error either in the GNU C++ library or in the pthread_create implementation: in case if any C++ exception was thrown and succesfully catched all "pthread_create" calls causes dead-lock. >How-To-Repeat: Just build and run the minimal example: ////// test.cpp #include #include void *thread(void *arg) { std::cout << "Thread" << std::endl; } void conditional_throw(bool arg) { if(arg) throw "Exception"; } int main(int argc, char *argv[]) { std::cout << "Start" << std::endl; try { conditional_throw(argc > 1 && ::strcasecmp(argv[1], "freeze") == 0); } catch(...) {} std::cout << "Create thread" << std::endl; pthread_t tid; int ret = ::pthread_create(&tid, 0, &thread, 0); if(ret != 0) return 1; ::sleep(1); std::cout << "Stop" << std::endl; return 0; } //// end of test.cpp You'll need to run it with command-line parameter "freeze" to get deadlock. >Fix: >Release-Note: >Audit-Trail: >Unformatted: