Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: does anyone else get a core dump from ldconfig when booting amd64-current?



On Jan 27,  5:41pm, njoly%pasteur.fr@localhost (Nicolas Joly) wrote:
-- Subject: Re: does anyone else get a core dump from ldconfig when booting a

| On Sun, Jan 25, 2009 at 02:28:03AM +0000, Christos Zoulas wrote:
| > In article <20090125012631.GA84416%medusa.sis.pasteur.fr@localhost>,
| > Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
| > >On Sun, Jan 25, 2009 at 12:45:14AM +0000, Christos Zoulas wrote:
| [...]
| > >njoly@lanfeust [~]> ktrace -di ./dummy
| > >zsh: bus error (core dumped)  ktrace -di ./dummy
| > >[...]
| > >   521      1 dummy    CALL  netbsd32_open(0xffffd490,0,0)
| > >   521      1 dummy    NAMI  "/emul/netbsd32/usr/lib/i386/libc.so.12"
| > >   521      1 dummy    NAMI  "/usr/lib/i386/libc.so.12"
| > >   521      1 dummy    RET   netbsd32_open 3
| > >   521      1 dummy    CALL  netbsd32___fstat50(3,0xffffd3d0)
| > >   521      1 dummy    RET   netbsd32___fstat50 0
| > >   521      1 dummy    CALL  netbsd32_close(3)
| > >   521      1 dummy    RET   netbsd32_close 0
| > >   521      1 dummy    PSIG  SIGBUS SIG_DFL: code=SI_USER sent by
| > >pid=-67194868, uid=0)
| > >   521      1 dummy    NAMI  "dummy.core"
| > 
| > Yes, I saw this. My theory is that the information that it gets from
| > stat is broken, and it does not load libc, but instead closes the fd.
| > I found the bug in the stat conversion and I committed a fix but I
| > doubt that this is the problem.
| 
| This is an alignment problem, with netbsd32_{timespec,timeval}
| structures ... Looks like the amd64 kernel use 64bit aligment, while
| `cc -m32' compiled programs expect 32bit aligned objects. The kernel
| structure is then larger than the userland expected one. Kaboom !!!
| 
| Not sure if this is a correct fix, but packing the netbsd32 structures
| make all of this work again.

I don't think that there is a cleaner way.

We could declare the structure as
        struct netbsd32_timeval  {
                int32_t tv_hsec;
                int32_t tv_lsec;
                int32_t tv_usec;
        }

and deal with hsec and lsec manually. Is that better?

christos


Home | Main Index | Thread Index | Old Index