From owner-freebsd-bugs Mon Jan 29 9: 0:23 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CD72337B69C for ; Mon, 29 Jan 2001 09:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0TH01q89402; Mon, 29 Jan 2001 09:00:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CC41D37B698 for ; Mon, 29 Jan 2001 08:50:41 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0TGofU88365; Mon, 29 Jan 2001 08:50:41 -0800 (PST) (envelope-from nobody) Message-Id: <200101291650.f0TGofU88365@freefall.freebsd.org> Date: Mon, 29 Jan 2001 08:50:41 -0800 (PST) From: dor@cwnt.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/24721: libgcc_r problem - library precedence with libstdc++ Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24721 >Category: bin >Synopsis: libgcc_r problem - library precedence with libstdc++ >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 29 09:00:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Dor Laor >Release: 4.2-release >Organization: Charlotte WEB >Environment: FreeBSD simba.cwnt.co.il 4.2-RELEASE FreeBSD 4.2-RELEASE #2: Wed Jan 17 16:22:29 GMT 2001 barak@simba.cwnt.co.il:/usr/src/sys/compile/COMPAQ_DL360 i386 >Description: The attached program creates cores using normal compilation & linking . The compilation command is: g++ -g3 try.cpp -pthread -o try // file try.cpp #include #include #include #include #include #include #include #include class a { public: a() { a1 = 0; } ~a() { int i; int a2[100]; for (i = 0; i < 100 ; i++) { a2[i] = i; } a1 = a2[0]; } int a1; }; class b : a { int b1; }; void func(void* arg) { int i; for (i=0;i<100000;i++) { b obj; b* p; p = &obj; } printf("thread done\n"); } void thread_creation(int i) { int rtn = 0; pthread_t id; if (rtn = pthread_create(&id, 0, (void * (*)(void *))func,NULL)) { printf(" could create thread\n"); } } int main() { for (int i=0; i< 100; i++) { thread_creation(i); } sleep(10); return 0; } >How-To-Repeat: Just run the program several times. >Fix: Link libgcc_r implictly with the executable- use command g++ -g3 try.cpp -pthread -lgcc_r -o try Note that if you put libstdc++ before gcc_r the problem remains >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message