From owner-freebsd-current@FreeBSD.ORG Thu Aug 26 16:22:31 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8F4F16A4CE; Thu, 26 Aug 2004 16:22:31 +0000 (GMT) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10D3943D55; Thu, 26 Aug 2004 16:22:31 +0000 (GMT) (envelope-from arno@heho.snv.jussieu.fr) Received: from heho.snv.jussieu.fr (heho.snv.jussieu.fr [134.157.184.22]) by shiva.jussieu.fr (8.12.11/jtpda-5.4) with ESMTP id i7QGLoDT067285 ; Thu, 26 Aug 2004 18:21:50 +0200 (CEST) X-Ids: 164 Received: from heho.snv.jussieu.fr (localhost [127.0.0.1]) i7QGMSN9021070 ; Thu, 26 Aug 2004 18:22:28 +0200 (MEST) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.13.1/8.13.1/Submit) id i7QGMRCL021067; Thu, 26 Aug 2004 18:22:27 +0200 (MEST) (envelope-from arno) To: freebsd-current@freebsd.org From: "Arno J. Klaassen" Date: 26 Aug 2004 18:22:27 +0200 Message-ID: Lines: 46 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at shiva.jussieu.fr with ID 412E0E1E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Antivirus: scanned by sophie at shiva.jussieu.fr cc: barner@gmx.de cc: nobutaka@freebsd.org Subject: boehm-gc, c++ and threads X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 16:22:32 -0000 Hello, does someone have a clue how to get boehm-gc for a multi-threaded C++ program? If I compile "int main (int argc, char *argv[]){}" with c++ -o a.out main.cc -L/usr/local/lib -lgc -lpthread I get the following segmentation fault : #0 0x280b1f54 in sched_yield () from /usr/lib/libpthread.so.1 #1 0x28099093 in GC_lock () from /usr/local/lib/libgc.so.1 #2 0x2809004d in GC_malloc () from /usr/local/lib/libgc.so.1 #3 0x280900ed in malloc () from /usr/local/lib/libgc.so.1 #4 0x280b8424 in pthread_mutex_init () from /usr/lib/libpthread.so.1 #5 0x280c28af in pthread_setconcurrency () from /usr/lib/libpthread.so.1 #6 0x280c22b5 in pthread_setconcurrency () from /usr/lib/libpthread.so.1 #7 0x280b6999 in pthread_self () from /usr/lib/libpthread.so.1 #8 0x280988a1 in GC_thr_init () from /usr/local/lib/libgc.so.1 #9 0x280944a0 in GC_init_inner () from /usr/local/lib/libgc.so.1 #10 0x2808fc31 in GC_generic_malloc_inner () from /usr/local/lib/libgc.so.1 #11 0x2808fdcf in GC_generic_malloc () from /usr/local/lib/libgc.so.1 #12 0x28090075 in GC_malloc () from /usr/local/lib/libgc.so.1 #13 0x280900ed in malloc () from /usr/local/lib/libgc.so.1 #14 0x280b8424 in pthread_mutex_init () from /usr/lib/libpthread.so.1 #15 0x280c28af in pthread_setconcurrency () from /usr/lib/libpthread.so.1 #16 0x280c22b5 in pthread_setconcurrency () from /usr/lib/libpthread.so.1 #17 0x280ba814 in pthread_mutex_lock () from /usr/lib/libpthread.so.1 #18 0x28185746 in __register_frame_info_bases () from /usr/lib/libstdc++.so.4 #19 0x281857c4 in __register_frame_info () from /usr/lib/libstdc++.so.4 #20 0x28113823 in ?? () from /usr/lib/libstdc++.so.4 #21 0x2818f250 in typeinfo for std::bad_exception () from /usr/lib/libstdc++.so.4 #22 0x281a4244 in ?? () from /usr/lib/libstdc++.so.4 #23 0x28072108 in ?? () #24 0x281bd62a in __ieee754_logf () from /lib/libm.so.2 #25 0x2810feb1 in _init () from /usr/lib/libstdc++.so.4 #26 0x2804faf9 in find_symdef () from /libexec/ld-elf.so.1 #27 0x2804e6ac in _rtld () from /libexec/ld-elf.so.1 #28 0x2804d966 in .rtld_start () from /libexec/ld-elf.so.1 I looked at the valgrind code how they got around the mallocs during threadlib initialisation, but it is beyond my competences. Any help appreciated. Regards, Arno