Full Disclosure mailing list archives
Re: gcc: Internal compiler error: program cc1 got fatal signal 11
From: Valdis.Kletnieks () vt edu
Date: Thu, 08 Jan 2004 23:04:52 -0500
On Thu, 08 Jan 2004 23:12:46 +0200, Georgi Guninski <guninski () guninski 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.
Attachment:
_bin
Description:
Current thread:
- Re: shell command (was: gcc: Internal compiler error: program cc1 got fatal signal 11), (continued)
- Re: shell command (was: gcc: Internal compiler error: program cc1 got fatal signal 11) Rev. Kronovohr (Jan 10)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Noldata TAC (Jan 08)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Dennis Freise (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 J.A. Terranson (Jan 08)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Steve Menard (Jan 08)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Michael Gebetsroither (Jan 08)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Daniel B (Jan 08)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Georgi Guninski (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Thomas Binder (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Kurt Schreiner (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Dale Harris (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 m.esco (Jan 09)
- Re: gcc: Internal compiler error: program cc1 got fatal signal 11 Dale Harris (Jan 09)