public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sparse segfaults
@ 2004-11-20 14:37 Russell King
  2004-11-20 16:58 ` Linus Torvalds
  2004-11-21 22:10 ` linux-os
  0 siblings, 2 replies; 18+ messages in thread
From: Russell King @ 2004-11-20 14:37 UTC (permalink / raw)
  To: Linus Torvalds, Linux Kernel List

Linus,

Sparse appears to segfault when trying to check kernel/timer.c:

  CC      kernel/ptrace.o
  CHECK   /home/rmk/bk/linux-2.6-rmk/kernel/timer.c
make[2]: *** [kernel/timer.o] Error 139
make[1]: *** [kernel] Error 2
make: *** [_all] Error 2

It doesn't seem to matter which ARM machine I have my kernel configured
for, the result is always the same.

#0  0x08059222 in expand_conditional (expr=0xf6a88c4c) at expand.c:478
478                     *expr = *true;
(gdb) where
#0  0x08059222 in expand_conditional (expr=0xf6a88c4c) at expand.c:478
#1  0x08059956 in expand_expression (expr=0xf6a88c4c) at expand.c:859
#2  0x08059a32 in expand_symbol (sym=0x5) at expand.c:917
#3  0x08048cc0 in clean_up_symbols (list=0x9464fb0) at check.c:100
#4  0x08048eb5 in main (argc=40, argv=0xfef19dc4) at check.c:192
(gdb) print expr
$1 = (struct expression *) 0xf6a88c4c
(gdb) print true
$2 = (struct expression *) 0x0
(gdb) print *expr
$3 = {type = EXPR_CONDITIONAL, op = 63, pos = {type = 6, stream = 1,
    newline = 0, whitespace = 1, pos = 22, line = 566, noexpand = 0},
  ctype = 0x80764a0, {value = 4138241036, fvalue = <invalid float value>,
    string = 0xf6a88c0c, unop = 0xf6a88c0c, statement = 0xf6a88c0c,
    expr_list = 0xf6a88c0c}}

Unfortunately, gdb won't show me the contents of expr->cond_true nor
expr->cond_false without the following:

(gdb) print *(&expr->string)
$4 = (struct string *) 0xf6a88c0c
(gdb) print *(&expr->string+1)
$5 = (struct string *) 0x0
(gdb) print *(&expr->string+2)
$6 = (struct string *) 0xf6a88c6c

Looks like expr->cond_true is NULL.  Line 566 of kernel/timer.c is:

int tickadj = 500/HZ ? : 1;             /* microsecs */

which makes it look like sparse doesn't understand such constructions.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: sparse segfaults
@ 2005-03-26 22:48 Jan Engelhardt
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Engelhardt @ 2005-03-26 22:48 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Linus Torvalds

Hi,


on Nov 22 2004, Linus Torvalds wrote 
( http://groups-beta.google.com/group/linux.kernel/brow
se_frm/thread/32c75ae8dd925ce7/5ca16f581a293fab?tvc=1#5ca16f581a293fab ):

>Same goes for the "extended lvalues". They are not only insane, but they
>mean that code like [...]


Well, here [http://gcc.gnu.org/gcc-3.4/changes.html] are some things (section 
"C/Objective C/C++") that will be deprecated, including ?: as an lvalue and
the behated (a,b)-as-lvalue.  ;-)


Cheers,
Jan Engelhardt
-- 
No TOFU for me, please.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-03-26 22:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-20 14:37 sparse segfaults Russell King
2004-11-20 16:58 ` Linus Torvalds
2004-11-20 17:23   ` Russell King
2004-11-21 22:10 ` linux-os
2004-11-21 22:29   ` Nikita Danilov
2004-11-21 22:37   ` Linus Torvalds
2004-11-21 22:44     ` Jan Engelhardt
2004-11-21 23:43       ` Mitchell Blank Jr
2004-11-22  1:02       ` Linus Torvalds
2004-11-22 10:33         ` Jan Engelhardt
2004-11-22 16:22           ` Linus Torvalds
2004-11-22 18:21             ` Jan Engelhardt
2004-11-22 18:39             ` Mitchell Blank Jr
2004-11-22 18:54               ` Linus Torvalds
2004-11-22 20:30                 ` Duncan Sands
2004-11-23 13:59                   ` Nix
2004-11-22 19:16               ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2005-03-26 22:48 Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox