[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <200401090404.i0944tXw005403@turing-police.cc.vt.edu>
From: Valdis.Kletnieks at vt.edu (Valdis.Kletnieks@...edu)
Subject: gcc: Internal compiler error: program cc1 got fatal signal 11
On Thu, 08 Jan 2004 23:12:46 +0200, Georgi Guninski <guninski@...inski.com> said:
> $ gcc --version
> 2.95.3
> $ cat gcc-crash.c
> int main(void)
> {
> printf("%c","msux"[0xcafebabe]);
> }
> $ gcc gcc-crash.c
> gcc: Internal compiler error: program cc1 got fatal signal 11
OK. To sum up:
1) "msux" ends up creating a semi-anonymous 5-byte long array, initialized to
that string.
2) 0xcafebabe as an index will try to get either the 3405691582 or -889275713 byte
of that string (depending on whether your compiler thinks it's a signed or unsigned index.
In either case, it points WAYY into the boonies.
3) This is why it *will* segfault at runtime. If it *fails* to segfault at runtime,
you have a *very* weird system indeed (or possibly very weird compiler flags ;)
4) gcc 2.95 is bombing out because it sees that the string is a constant, the index
is a constant, and it's trying to reduce it at compile time (similar to how if
you had used "msux"[3] it could replace that with a 'x'). It's failing to note that
the index is out-of-range of the string.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 226 bytes
Desc: not available
Url : http://lists.grok.org.uk/pipermail/full-disclosure/attachments/20040108/8ed228ea/attachment.bin
Powered by blists - more mailing lists