From owner-freebsd-questions Tue Jun 13 2:28:48 2000 Delivered-To: freebsd-questions@freebsd.org Received: from moutvdom00.kundenserver.de (moutvdom00.kundenserver.de [195.20.224.149]) by hub.freebsd.org (Postfix) with ESMTP id E7B8A37BB17 for ; Tue, 13 Jun 2000 02:28:43 -0700 (PDT) (envelope-from duz@onlinehome.de) Received: from [195.20.224.204] (helo=mrvdom00.kundenserver.de) by moutvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 131mzy-0004vE-00 for questions@freebsd.org; Tue, 13 Jun 2000 11:28:42 +0200 Received: from a389e.pppool.de ([213.6.56.158] helo=onlinehome.de) by mrvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 131mzi-0005uk-00 for questions@FreeBSD.org; Tue, 13 Jun 2000 11:28:26 +0200 Message-ID: <3945FEBA.28CBF4AD@onlinehome.de> Date: Tue, 13 Jun 2000 11:28:26 +0200 From: Dirk Zoller Organization: none X-Mailer: Mozilla 4.72 [en] (X11; I; FreeBSD 4.0-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: questions@FreeBSD.org Subject: I'm unable to profile multithreaded C++ Code. Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello together, unfortunately, my *multithreaded* C++ programs crash with a bus error when I'm trying to *profile*. The error happens in in the first global constructor being called. I'm using FreeBSD-4.0-STABLE for Intel, freshly cvsup'd and world made. I'm compiling using the gcc-2.95.2 which comes with that finest of all operating systems. I compile and link using c++ -pthread -g -pg ... (lots of -I and -D I spare you) where -v reports a linker line which includes: /usr/libexec/elf/ld -m elf_i386 -dynamic-linker /usr/libexec/ld-elf.so.1 -o irrelevant /usr/lib/gcrt1.o /usr/lib/crti.o /usr/lib/crtbegin.o (some irrelevant -L I spare you) -L/usr/local/lib -L/usr/X11R6/lib -L/usr/libexec/elf -L/usr/libexec -L/usr/lib (some irrelevant *.o and -l) -lcipher -lstdc++ -lm /usr/lib/libgcc_r.a -lc_r_p /usr/lib/libgcc_r.a /usr/lib/crtend.o /usr/lib/crtn.o The rest are assumptions/observations. I studied the stuff inside /usr/lib/gcrt1.o from _start and how profiling is initialized using monstartup() prior to running the global constructors in _init. What I read in all those little files in /usr/src/lib/csu/i386-elf makes a lot of sense to me. I find it very likely that monstartup is actually called. Then I tried to set a breakpoint in monstartup. Apparently this is never hit. Instead I get the bus error with a traceback which seems to point into my global constructors. Alas, I doubt this backtrace, because do_ctors() is missing from the function call hierarchy. I find it more likely that I'm in fact inside monstartup. And that monstartup crashes for whatever reason. Did anybody succeed in profiling multithreaded C++ stuff?? I'm appreciating any hint. Dirk -- Dirk Zoller Fon: 06106-876566 Obere Marktstraße 5 e-mail: duz@sol-3.de 63110 Rodgau To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message