[M3devel] linuxlibc6 jmpbuf size?
Jay
jay.krell at cornell.edu
Sun Mar 15 19:13:32 CET 2009
I hadn't, but it is 4, and that is factored
into printing the size in C, though
not factored into adding up the size by hand.
I did both. I first noticed the disprepancy
when a change I had locally made Csetjmp.i3 not compile,
(missing Usignal.sigset_t)
so I ran config.c. Though since config.c is kind
of complicated, also ran:
jay at localhost ~ $ uname -a
Linux localhost 2.6.25-gentoo-r7 #5 Sun Oct 5 18:59:56 Local time zone must be set--see zic manua i5
86 Geode(TM) Integrated Processor by AMD PCS AuthenticAMD GNU/Linux
jay at localhost ~ $ cat 1.c
#include
#include
typedef unsigned U;
int main()
{
jmp_buf jb[2];
printf("%u\n", (U)sizeof(jb));
printf("%u\n", (U)sizeof(jmp_buf));
printf("%u\n", (U)__alignof(jmp_buf));
return 0;
}
jay at localhost ~ $ cc 1.c
.jay at localhost ~ $ ./a.out
312
156
4
(eek, hadn't noticed the clock being wrong before, though I had noticed the timezone)
- Jay
----------------------------------------
> CC: m3devel at elegosoft.com
> From: hosking at cs.purdue.edu
> To: jay.krell at cornell.edu
> Subject: Re: [M3devel] linuxlibc6 jmpbuf size?
> Date: Mon, 16 Mar 2009 03:05:58 +1100
>
> Have you checked all the alignments?
>
> On 15 Mar 2009, at 21:24, Jay wrote:
>
>>
>> The Linuxlibc6 jmpbuf size looks clearly wrong, just slightly
>> inflated.
>> It should be 39 * address, not 40.
>> Any objections to fixing it?
>>
>>
>> This is the one that fits the signal mask.
>> Only 6 addresses are needed if signal mask isn't saved.
>> Plus 1 to record if it is saved.
>> Plus 1024 bits for a glibc signal mask, even though the kernel only
>> supports 128 signals on mips and 64 on all others..big waste imho..
>>
>>
>> 6 + 1 + 1024/32 = 39.
>>
>> Hm. I rather think we should shorten it to 6, 7, or 11 really, after
>> confirming we can.
>> (11: 6 for registers, 1 to indicate if signal mask saved, 4 for
>> signal mask; or 7: 6 for registers and 1 to hold zero to indicate
>> signal mask not saved; or 6: registers and implied/known no signal
>> mask saved, if that is the case, I have to check).
>>
>> See
>> http://lists.uclibc.org/pipermail/uclibc/2008-December/041674.html
>>
>> for details on the signal mask size..
>>
>> - Jay
>
More information about the M3devel
mailing list