Subject: Re: weird benchmarks/bonnie crash may reveal possible GDB or compiler bug on 1.6.1 alpha
To: Wilko Bulte <wkb@freebie.xs4all.nl>
From: Greg A. Woods <woods@weird.com>
List: port-alpha
Date: 08/01/2003 16:46:22
[ On Friday, August 1, 2003 at 21:38:25 (+0200), Wilko Bulte wrote: ]
> Subject: Re: weird benchmarks/bonnie crash may reveal possible GDB or compiler bug on 1.6.1 alpha
>
> On Fri, Aug 01, 2003 at 03:28:36PM -0400, Greg A. Woods wrote:
> 
> 
> I'm not sure about the gcc on NetBSD but on FreeBSD/alpha all
> optimisation levels > -O are considered doomed.
> 
> Maybe a quick test with -O might be useful?

Hmmm... interesting.

Unfortunately using just '-O' seems to make no difference:

$ cc -v 
Using builtin specs.
gcc version 2.95.3 20010315 (release) (NetBSD nb3)
$ cc --version
2.95.3
$ cc -g -O -mieee -pipe   -Werror -mieee     -c bonnie.c   
$ cc -g -O -static -L/usr/lib -static -o bonnie  bonnie.o 
$ gdb ./bonnie                                            
GNU gdb 5.0nb1
Copyright 2000 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 "alpha-unknown-netbsd"...
(gdb) run -s 2
Starting program: /var/package-obj/benchmarks/bonnie/work/./bonnie -s 2
File './Bonnie.24722', size: 2097152
Writing with putc()...done
Rewriting...done
Writing intelligently...done
Reading with getc()...done
Reading intelligently...done
Seeker 1...Seeker 2...Seeker 3...start 'em...done...done...done...
              -------Sequential Output-------- ---Sequential Input-- --Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU

Program received signal SIGSEGV, Segmentation fault.
0x12000a7c4 in memchr ()
(gdb) where
#0  0x12000a7c4 in memchr ()
#1  0x12000d168 in __dtoa ()
#2  0x120009864 in vfprintf ()
warning: Hit beginning of text section without finding
warning: enclosing function for address 0x18
This warning occurs if you are debugging a function without any symbols
(for example, in a stripped executable).  In that case, you may wish to
increase the size of the search with the `set heuristic-fence-post' command.

Otherwise, you told GDB there was a function where there isn't one, or
(more likely) you have encountered a bug in GDB.
(gdb) 


I suppose I'd have to recompile at least all of libc as well just to be
sure though....

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>