Thanks, Erik. And of those, how many don’t end with arrays or would not use 
earlier members to access those arrays? I’m still kind of dubious that there 
are any structures where one would not catch a null pointer.

Of course, this is not the original issue, which was someone fooling the kernel 
into doing something it might now have wanted to do.

> On Nov 26, 2015, at 11:31 AM, erik quanstrom <quans...@quanstro.net> wrote:
> 
> On Thu Nov 26 03:25:34 PST 2015, brantleyco...@me.com wrote:
> 
>> Hi Bakul.  Long time since our Bay Area plan 9 hacking sessions. I've 
>> avoided the valley all together for a year and a half now. Not quite long 
>> enough yet. 
>> 
>> I thought the same thing, using ~0 for nil, but realized two things. First, 
>> that's a valid address on the PDP11 where the convention developed. It's the 
>> unibus space. Second, ~0 + member offest is still in page zero. 
>> 
>> By the way, are there any structs more than 4K in Linux? Are there any in 
>> plan 9?
> 
> since that 4k is really pagesz, on amd64 that would be 2mb.  there's no 
> compelling reason on
> 64-bit machines to start at the bottom instead of the middle.
> 
> the answer to the question is yes, yes there are.  by Biobufs are larger than 
> the original, but
> they are normally 8k.
> 
> ; cd /sys/src/cmd
> ; grep sizeof `{find .|grep acid}|sed 's/;$//g'|awk '$NF ~ /^[0-9][0-9]*$/ && 
> $NF>4096'
> ./8l/acid6:sizeofBiobuf = 8272
> ./8l/acid6:sizeof_4_ = 16384
> ./8l/acid6:sizeof_5_ = 16384
> ./acid/acid6:sizeofBiobuf = 8248
> ./aux/vga/acid6:sizeofBiobuf = 49232
> ./mk/acid:sizeofBiobuf = 8248
> ./stats.acid:sizeofAuthRpc = 8216
> ./stats.acid:sizeofEvent = 8368
> ./6l/acid6:sizeofBiobuf = 8272
> ./6l/acid6:sizeof_4_ = 16384
> ./6l/acid6:sizeof_5_ = 16384
> 
> this is not an exhaustive list.
> 
> - erik
> 


Reply via email to