From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 4 09:21:02 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 025DA1065678 for ; Fri, 4 Jul 2008 09:21:02 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 668038FC1E for ; Fri, 4 Jul 2008 09:21:01 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.2/8.14.2) with ESMTP id m6491B5O081544; Fri, 4 Jul 2008 13:01:11 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Fri, 4 Jul 2008 13:01:11 +0400 (MSD) From: Dmitry Morozovsky To: freebsd-hackers@FreeBSD.org Message-ID: <20080704121833.J35668@woozle.rinet.ru> X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (woozle.rinet.ru [0.0.0.0]); Fri, 04 Jul 2008 13:01:11 +0400 (MSD) Cc: oleg@rinet.ru Subject: profiling broken on RELENG_7/i386 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2008 09:21:02 -0000 Dear colleagues, It seems we step on a bug in gcc in RELENG_7/i386 It is triggered at least by profiling program which uses getopt(3): marck@ref7-i386:~/tmp/gprof> cat test.c #include int main(int argc, char *argv[]) { int ch; while ((ch = getopt(argc, argv, "")) != -1) { } return (0); } marck@ref7-i386:~/tmp/gprof> make Warning: Object directory not changed from original /dumpster/home/marck/tmp/gprof cc -O2 -fno-strict-aliasing -pipe -march=prescott -g -pg -c test.c cc -O2 -fno-strict-aliasing -pipe -march=prescott -g -pg -o test test.o marck@ref7-i386:~/tmp/gprof> ./test Segmentation fault (core dumped) marck@ref7-i386:~/tmp/gprof> gdb test test.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... Core was generated by `test'. Program terminated with signal 11, Segmentation fault. #0 0x080481e0 in main (argc=Cannot access memory at address 0x1b ) at test.c:6 6 { (gdb) l 1 2 #include 3 4 int 5 main(int argc, char *argv[]) 6 { 7 int ch; 8 9 while ((ch = getopt(argc, argv, "")) != -1) { 10 } (gdb) marck@ref7-i386:~/tmp/gprof> truss ./test __sysctl(0xbf7feb0c,0x2,0x806bf70,0xbf7feb18,0x0,0x0) = 0 (0x0) __sysctl(0xbf7fe64c,0x2,0x806d558,0xbf7fe654,0x0,0x0) = 0 (0x0) __sysctl(0xbf7fe69c,0x2,0xbf7fe6a8,0xbf7fe6ac,0x0,0x0) = 0 (0x0) readlink("/etc/malloc.conf","aj",1024) = 2 (0x2) issetugid(0x8066d0d,0xbf7fe70b,0x400,0xbf7feb18,0x0,0x0) = 0 (0x0) break(0x8100000) = 0 (0x0) break(0x8200000) = 0 (0x0) sysarch(0xa,0xbf7feba0,0xbf7febc8,0x8048555,0x8102040,0xc) = 0 (0x0) break(0x8226004) = 0 (0x0) profil(0x82075a8,0xf52e,0x8048148,0x8000,0x0,0x0) = 0 (0x0) SIGNAL 11 (SIGSEGV) other ref platforms seem to be ok. Any hints? Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------