From: Stephen Hemminger <shemminger@vyatta.com>
To: Kamil Dudka <kdudka@redhat.com>
Cc: Josh Triplett <josh@kernel.org>, linux-sparse@vger.kernel.org
Subject: Re: sparse segv with simple test
Date: Mon, 31 Aug 2009 08:57:58 -0700 [thread overview]
Message-ID: <20090831085758.540365f2@nehalam> (raw)
In-Reply-To: <200908310053.59138.kdudka@redhat.com>
On Mon, 31 Aug 2009 00:53:58 +0200
Kamil Dudka <kdudka@redhat.com> wrote:
> On Monday 31 of August 2009 00:32:02 Stephen Hemminger wrote:
> > I was checking up on some enum issues and tried running the following:
> > sparse -Wenum-mismatch enum.c
> > It dies here:
> > gdb) run -Wenum-mismatch e.c
> > Starting program: /home/shemminger/src/sparse/sparse -Wenum-mismatch enum.c
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0805c81d in linearize_store_gen (ep=0xb7e7600c, value=0xb7e4e00c,
> > ad=0xbfd43134) at linearize.h:293
> > 293 return (p && p->type != PSEUDO_VOID && p->type != PSEUDO_VAL);
> > (gdb) where
> > #0 0x0805c81d in linearize_store_gen (ep=0xb7e7600c, value=0xb7e4e00c,
> > ad=0xbfd43134) at linearize.h:293
> > #1 0x080609da in linearize_symbol (sym=0xb7e244cc) at linearize.c:1526
> > #2 0x080494bd in main (argc=-1209907772, argv=0xb7e245c4) at sparse.c:266
> > ------
> > #include <stdio.h>
> >
> > enum x { A, B, C };
> >
> > static enum x foo(int n) {
> > return (n > 0) ? A : B;
> > }
> >
> > int main(int ac, char **av) {
> > int x = foo(ac);
> > enum x y = 99;
> >
> > printf("%d %d\n", x, y);
> > return 0;
> > }
>
> I am unable to reproduce the crash, tested with sparse 0.4.1 and current git
> HEAD. Even no suspicious place reported by valgrind. Maybe your <stdio.h> is
> the trigger. Could you please attach the preprocessed code?
>
> Kamil
Not sure why, but the crash went away after a 'make clean; make' so maybe
something was stale on that machine?
It still doesn't give any warnings. about assigning an enum with a value
out of range thou.
--
next prev parent reply other threads:[~2009-08-31 15:58 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-30 22:32 sparse segv with simple test Stephen Hemminger
2009-08-30 22:53 ` Kamil Dudka
2009-08-31 15:57 ` Stephen Hemminger [this message]
2009-08-31 18:12 ` Kamil Dudka
2009-08-31 18:49 ` Stephen Hemminger
2009-08-31 19:04 ` Kamil Dudka
2009-08-31 20:53 ` Josh Triplett
2009-09-01 21:59 ` [PATCH] add warnings enum-to-int and int-to-enum Kamil Dudka
2009-09-01 23:24 ` Josh Triplett
2009-09-02 0:27 ` Stephen Hemminger
2009-09-02 17:56 ` Daniel Barkalow
2009-09-02 18:04 ` Kamil Dudka
2009-09-02 18:43 ` Daniel Barkalow
2009-09-02 18:56 ` Josh Triplett
2009-09-02 19:19 ` Daniel Barkalow
2009-09-02 19:58 ` Kamil Dudka
2009-09-02 11:53 ` Kamil Dudka
2009-09-02 15:21 ` Josh Triplett
2009-09-02 16:23 ` Kamil Dudka
2009-09-02 16:38 ` Christopher Li
2009-09-02 19:03 ` Josh Triplett
2009-09-02 19:19 ` Kamil Dudka
2009-09-02 22:35 ` Kamil Dudka
2009-09-03 9:42 ` Christopher Li
2009-09-03 11:47 ` Kamil Dudka
2009-09-03 18:38 ` Christopher Li
2009-09-03 18:54 ` Kamil Dudka
2009-09-03 20:02 ` Christopher Li
2009-09-13 19:28 ` Kamil Dudka
2009-09-13 19:55 ` Christopher Li
2009-09-13 20:09 ` Kamil Dudka
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=20090831085758.540365f2@nehalam \
--to=shemminger@vyatta.com \
--cc=josh@kernel.org \
--cc=kdudka@redhat.com \
--cc=linux-sparse@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).