[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1231532276.2081.12.camel@entropy>
Date: Fri, 09 Jan 2009 12:17:56 -0800
From: Nicholas Miell <nmiell@...cast.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ingo Molnar <mingo@...e.hu>, jim owens <jowens@...com>,
"H. Peter Anvin" <hpa@...or.com>,
Chris Mason <chris.mason@...cle.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
paulmck@...ux.vnet.ibm.com, Gregory Haskins <ghaskins@...ell.com>,
Matthew Wilcox <matthew@....cx>,
Andi Kleen <andi@...stfloor.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-btrfs <linux-btrfs@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Nick Piggin <npiggin@...e.de>,
Peter Morreale <pmorreale@...ell.com>,
Sven Dietrich <SDietrich@...ell.com>
Subject: Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y
impact
On Fri, 2009-01-09 at 08:28 -0800, Linus Torvalds wrote:
>
> We get oopses that have a nice symbolic back-trace, and it reports an
> error IN TOTALLY THE WRONG FUNCTION, because gcc "helpfully" inlined
> things to the point that only an expert can realize "oh, the bug was
> actually five hundred lines up, in that other function that was just
> called once, so gcc inlined it even though it is huge".
>
> See? THIS is the problem with gcc heuristics. It's not about quality of
> code, it's about RELIABILITY of code.
[bt]$ cat backtrace.c
#include <stdlib.h>
static void called_once()
{
abort();
}
int main(int argc, char* argv[])
{
called_once();
return 0;
}
[bt]$ gcc -Wall -O2 -g backtrace.c -o backtrace
[bt]$ gdb --quiet backtrace
(gdb) disassemble main
Dump of assembler code for function main:
0x00000000004004d0 <main+0>: sub $0x8,%rsp
0x00000000004004d4 <called_once+0>: callq 0x4003b8 <abort@plt>
End of assembler dump.
(gdb) run
Starting program: /home/nicholas/src/bitbucket/bt/backtrace
Program received signal SIGABRT, Aborted.
0x0000003d9dc32f05 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0 0x0000003d9dc32f05 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0000003d9dc34a73 in abort () at abort.c:88
#2 0x00000000004004d9 in called_once () at backtrace.c:5
#3 main (argc=3989, argv=0xf95) at backtrace.c:10
(gdb)
Maybe the kernel's backtrace code should be fixed instead of blaming
gcc.
--
Nicholas Miell <nmiell@...cast.net>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists