From mboxrd@z Thu Jan 1 00:00:00 1970 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.0 \(3094\)) From: Brantley Coile In-reply-to: Date: Thu, 26 Nov 2015 11:42:07 -0500 Content-transfer-encoding: quoted-printable Message-id: <2E002088-41D4-46D9-A614-566C31F04E76@me.com> References: <20151125160347.GN20646@sigint.cs.purdue.edu> <79F2255E-5E76-43E8-83B3-0DFB2CD34AC7@bitblocks.com> <3175949A-26D0-4C4A-BB7D-4E5A3EA7F8B7@me.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] Undefined Behaviour in C Topicbox-Message-UUID: 77d0baac-ead9-11e9-9d60-3106f5b1d025 Thanks, Erik. And of those, how many don=E2=80=99t end with arrays or = would not use earlier members to access those arrays? I=E2=80=99m 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 = wrote: >=20 > On Thu Nov 26 03:25:34 PST 2015, brantleycoile@me.com wrote: >=20 >> 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.=20 >>=20 >> 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.=20 >>=20 >> By the way, are there any structs more than 4K in Linux? Are there = any in plan 9? >=20 > 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. >=20 > the answer to the question is yes, yes there are. by Biobufs are = larger than the original, but > they are normally 8k. >=20 > ; cd /sys/src/cmd > ; grep sizeof `{find .|grep acid}|sed 's/;$//g'|awk '$NF ~ = /^[0-9][0-9]*$/ && $NF>4096' > ./8l/acid6:sizeofBiobuf =3D 8272 > ./8l/acid6:sizeof_4_ =3D 16384 > ./8l/acid6:sizeof_5_ =3D 16384 > ./acid/acid6:sizeofBiobuf =3D 8248 > ./aux/vga/acid6:sizeofBiobuf =3D 49232 > ./mk/acid:sizeofBiobuf =3D 8248 > ./stats.acid:sizeofAuthRpc =3D 8216 > ./stats.acid:sizeofEvent =3D 8368 > ./6l/acid6:sizeofBiobuf =3D 8272 > ./6l/acid6:sizeof_4_ =3D 16384 > ./6l/acid6:sizeof_5_ =3D 16384 >=20 > this is not an exhaustive list. >=20 > - erik >=20