[OpenAFS-devel] Crash on AIX 6.1 TL6 SP3

Derrick Brashear shadow@gmail.com
Tue, 15 Mar 2011 02:16:25 -0400


On Thu, Mar 3, 2011 at 10:55 AM, Derrick Brashear <shadow@gmail.com> wrote:
> wild guess: m_hdr changed size because of:
>
> - =A0 =A0 =A0 =A0m_contig_t *mh_contig; =A0 =A0 =A0 =A0 =A0/* contig mpoo=
l support struct */
> + =A0 =A0 =A0 =A0struct mclContig *mh_contig; =A0 =A0 =A0 =A0 =A0 =A0/* c=
ontig mpool support struct
> */
>
> where
> -typedef struct m_contig
> -{
> - =A0 =A0 =A0 =A0caddr_t va; =A0 =A0 =A0 =A0 =A0 =A0 /* addr of contiguou=
s block */
> - =A0 =A0 =A0 =A0uint =A0 =A0elemsize; =A0 =A0 =A0 /* size of the element=
s of the block */
> - =A0 =A0 =A0 =A0uint =A0 =A0elemcnt; =A0 =A0 =A0 =A0/* # of elements in =
the block */
> - =A0 =A0 =A0 =A0ulong =A0 freecnt; =A0 =A0 =A0 =A0/* how many of these h=
ave been freed */
> - =A0 =A0 =A0 =A0memreg_t memreg; =A0 =A0 =A0 =A0/* contains the mem reg =
corr for block */
> -} m_contig_t;
>
> +typedef struct mclContig {
> + =A0 =A0 =A0 =A0caddr_t mclcCB; =A0 =A0 =A0 =A0 =A0 =A0 /* addr of conti=
guous block */
> + =A0 =A0 =A0 =A0uint32_t mclcElemSize; =A0/* size of the elements of the=
 block */
> + =A0 =A0 =A0 =A0uint32_t mclcElemCnt; =A0 /* # of elements in the block =
*/
> + =A0 =A0 =A0 =A0memreg_t mclcMemReg; =A0 =A0/* contains the mem reg corr=
 for block */
> +} mclContig_t;
>
> meaning struct mbuf shrank by 4 bytes
>
> so the question is, what's the best way to get a mbuf provided to us
> by the kernel that we can check out the size, and
> then presumably we provide our own struct mbufs, so we can make
> m_next, m_len, m_flags, m_ext, m_pkthdr and whatever
> else be instead macros which dtrt given what we booted on... and screw
> the whole "build twice" plan.

kern_sogetopt will return to us an mbuf allocated by the kernel.
so then it's just a matter of figuring out how we can discern from
that mbuf which size we are,
which even if we do not provide MGET/MGETHDR can at least mean we
don't panic, but instead
fail to mount AFS.