Hello world segfaults with -static
Martin Kahlert
martin.kahlert@infineon.com
Thu Oct 11 00:11:00 GMT 2001
On Wed, Oct 10, 2001 at 09:26:18AM -0700, Boehm, Hans wrote:
> That's a new one for me. And I don't have clue as to how that could happen.
> With only a single entry in the table, GC_next_exclusion should return
> either 0 or the address of the zeroth entry in GC_excl_table. It looks to
> me like next_index can be only 0 or 1.
>> Can you build mark_rts.c unoptimized? If that still breaks, can you step
> through GC_exclude_static_roots to see where I'm wrong?
I do not think your code is wrong.
I think it's gcc's fault:
I changed
if (0 == GC_excl_table_entries) {
next = 0;
} else {
next = GC_next_exclusion(start);
}
to
if (0 == GC_excl_table_entries) {
next = 0;
} else {
next = GC_next_exclusion(start);
printf("GC_excl_table = %p next = %p, diff = %i\n",
GC_excl_table, next, next - GC_excl_table);
}
And i get this:
GC_excl_table = 0x820b7ec next = 0x820b7ec, diff = 11163
So gcc seems to have problems with its arithmetic.
Hope that helps,
Martin.
PS: I tried a bit to get a smaller testcase, but gcc was always correct for my
examples, sorry.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.
More information about the Java
mailing list