From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30553 invoked by alias); 15 Feb 2005 21:43:40 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30479 invoked by uid 48); 15 Feb 2005 21:43:32 -0000 Date: Wed, 16 Feb 2005 03:32:00 -0000 From: "lothar at xcerla dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20050215214329.19985.lothar@xcerla.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/19985] New: executables created with -fprofile-arcs -ftest-coverage segfault in gcov_exit () X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg01665.txt.bz2 List-Id: I created a small test I will attach to this bug report that shows that executables created with -fprofile-arcs -ftest-coverage crash in gcov_exit () if they dynamically load functions from libraries. I tested with gcc 3.4.1 and 4.0-20050213. Both show the same problem. Here's the gdb stack trace for both compilers: Program terminated with signal 11, Segmentation fault. #0 gcov_exit () at ../../gcc-3.4.1/gcc/libgcov.c:139 139 if (!((1 << t_ix) & gi_ptr->ctr_mask)) (gdb) where #0 gcov_exit () at ../../gcc-3.4.1/gcc/libgcov.c:139 #1 0x4018b820 in exit () from /lib/tls/libc.so.6 #2 0x40176b1a in __libc_start_main () from /lib/tls/libc.so.6 #3 0x080491b1 in _start () at ../sysdeps/i386/elf/start.S:119 Program terminated with signal 11, Segmentation fault. #0 gcov_exit () at ../../gcc-4.0-20050213/gcc/libgcov.c:139 139 if (!((1 << t_ix) & gi_ptr->ctr_mask)) ((gdb) where #0 gcov_exit () at ../../gcc-4.0-20050213/gcc/libgcov.c:139 #1 0x4018b820 in exit () from /lib/tls/libc.so.6 #2 0x40176b1a in __libc_start_main () from /lib/tls/libc.so.6 #3 0x08049031 in _start () at ../sysdeps/i386/elf/start.S:119 The test uses SCons as a build tool. But I give the build arguments here for the 3.4.1 compiler: /opt2/GNU/bin/g++-3.4.1 -O0 -g -D_REENTRANT -W -Wall -Wpointer-arith -Wno-uninitialized -Woverloaded-virtual -Wcast-align -Wwrite-strings -Wcomments -march=pentiumpro -DCOVERAGE -fprofile-arcs -ftest-coverage -Isrc -c -o src/prog/.build/posix/coverage/main.o src/prog/main.cpp /opt2/GNU/bin/g++-3.4.1 -g -Wl,-E -o bin/posix/coverage/prog src/prog/.build/posix/coverage/main.o -Llib/posix/coverage -lstdc++ -lpthread -lrt -ldl -lgcov /opt2/GNU/bin/g++-3.4.1 -O0 -g -D_REENTRANT -W -Wall -Wpointer-arith -Wno-uninitialized -Woverloaded-virtual -Wcast-align -Wwrite-strings -Wcomments -march=pentiumpro -DCOVERAGE -fprofile-arcs -ftest-coverage -fPIC -Isrc -c -o src/calc/.build/posix/coverage/calc.os src/calc/calc.cpp /opt2/GNU/bin/g++-3.4.1 -g -Wl,-E -Wl,-soname=libcalc.so.1.0 -shared -o lib/posix/coverage/libcalc.so src/calc/.build/posix/coverage/calc.os -Llib/posix/coverage -lstdc++ -lpthread -lrt -ldl -lgcov Lothar -- Summary: executables created with -fprofile-arcs -ftest-coverage segfault in gcov_exit () Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lothar at xcerla dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19985