This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix libbacktrace on 32-bit sparc
From: Ian Lance Taylor <iant@google.com>
Date: Sat, 27 Oct 2012 21:06:59 -0700
> The struct used by add_function_range is
>
> struct function_addrs
> {
> uint64_t low;
> uint64_t high;
> struct function *function;
> };
>
> So on a 32-bit system, this should have a size of 20 if uint64_t
> requires 4-byte alignment, but it should have a size of 24 if uint64_t
> requires 8-byte alignment. It sounds like uint64_t requires 8-byte
> alignment, so the size of this struct should be 24, so your patch
> shouldn't change matters. Since your patch presumably works, it
> sounds like sizeof (struct function_addrs) is returning 20, but that
> does not make sense. It would mean that allocating an array of struct
> function_addrs wouldn't work correctly.
>
> So I don't know what is going on.
The size is 24, and my patch definitely makes the crashes go away.
It seems like a vector is being used for a mixed set of objects.
I'll try to figure out how that is happening.