9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Brantley Coile <brantleycoile@me.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Undefined Behaviour in C
Date: Thu, 26 Nov 2015 11:42:07 -0500	[thread overview]
Message-ID: <2E002088-41D4-46D9-A614-566C31F04E76@me.com> (raw)
In-Reply-To: <bc06c556b044e2c5391225e0f023264b@bwc>

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 <quanstro@quanstro.net> wrote:
> 
> On Thu Nov 26 03:25:34 PST 2015, brantleycoile@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	other threads:[~2015-11-26 16:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 10:20 Ramakrishnan Muthukrishnan
2015-11-23 11:20 ` Vasudev Kamath
2015-11-25 10:27   ` Alexandru Gheorghe
2015-11-25 10:43     ` Brantley Coile
2015-11-25 10:53       ` Brantley Coile
2015-11-25 12:59       ` Charles Forsyth
2015-11-25 13:48         ` erik quanstrom
2015-11-25 14:25           ` Brantley Coile
2015-11-25 14:31             ` Brantley Coile
2015-11-25 16:03             ` plannine
2015-11-25 17:13               ` Ryan Gonzalez
2015-11-25 18:41                 ` Brantley Coile
2015-11-26  2:04                   ` Prof Brucee
2015-11-26  2:43                     ` Brantley Coile
2015-11-26  2:57                       ` Prof Brucee
2015-11-26  3:48                         ` Ryan Gonzalez
2015-11-26  7:27                     ` Bakul Shah
2015-11-26 11:22                       ` Brantley Coile
2015-11-26 11:37                         ` tlaronde
2015-11-26 11:55                           ` Charles Forsyth
2015-11-26 11:38                         ` Bruce Ellis
2015-11-26 16:31                         ` erik quanstrom
2015-11-26 16:42                           ` Brantley Coile [this message]
2015-11-26 16:50                             ` Charles Forsyth
2015-11-26 17:12                               ` erik quanstrom
2015-11-26 16:46                           ` Alexandru Gheorghe
2015-11-26 17:48                         ` Bakul Shah
2015-11-26 18:04                           ` Brantley Coile
2015-11-26 23:14                           ` Steve Simon
2015-11-26 23:24                             ` Charles Forsyth
2015-11-26 23:55                             ` Brantley Coile
2015-11-25 19:19               ` Steffen Nurpmeso
2015-11-23 11:32 ` Charles Forsyth
2015-11-23 11:37   ` Charles Forsyth
2015-11-23 11:50 ` Brantley Coile
2015-11-23 12:05   ` Charles Forsyth
2015-11-23 12:17     ` Brantley Coile
2015-11-23 12:40       ` Charles Forsyth
2015-11-23 12:09   ` Charles Forsyth
2015-11-23 14:30 ` Charles Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2E002088-41D4-46D9-A614-566C31F04E76@me.com \
    --to=brantleycoile@me.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).