[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Full-Disclosure] gcc: Internal compiler error: program cc1 got fatal signal 11



On Thu, 08 Jan 2004 23:04:52 -0500
Valdis.Kletnieks@vt.edu wrote:

> OK. To sum up:
> 
snip
> 
> 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.
> 

your arguments don't seem to be consistent with this test ;) :

$ gcc --version
2.95.3
$ cat gcc-no2.c
int main(void)
{
char c="msux"[0x7fffffff];
printf("%c",c);
}
$ gcc gcc-no2.c
$ ./a.out
Memory fault (core dumped)
$ gdb ./a.out ./a.out.core
#0  0x1c000550 in main ()
(gdb) x/i $eip
0x1c000550 <main+16>:   mov    (%edx,%eax,1),%al
(gdb) p/x $eax
$1 = 0x3c000001
(gdb) p/x $edx
$2 = 0x7fffffff


compile passes, but the proggie crashes, so "msux"[INDEX] doesn't seem to be 
expanded to char at compile time.

iirc the gcc crash is in xstrdup or something like this.

georgi

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html