public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: sparse segfaults
Date: Sat, 20 Nov 2004 14:37:55 +0000	[thread overview]
Message-ID: <20041120143755.E13550@flint.arm.linux.org.uk> (raw)

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

             reply	other threads:[~2004-11-20 14:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-20 14:37 Russell King [this message]
2004-11-20 16:58 ` sparse segfaults 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041120143755.E13550@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox