Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2012 03:26:01 +0530
From:      Shrikanth Kamath <shrikanth07@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   DTrace 32 bit on 64 bit machine?
Message-ID:  <CAEOAkMXo83s6OmdcLDz6-LiW2PZ9YZomLfVagd8-vM44sKZSWg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Can the DTrace user space application compiled as 32 bit app be run on
machine with x86_64 kernel

I have this DTrace port done for code base based on FreeBSD 6.1, and
the app is crashing on the amd64 machine with assert

Assertion failed: (fsz > 0), function _libelf_getphdr, file
../../../../src/bsd/lib/libelf/libelf_phdr.c, lie 83.

I do not have the user space DTrace enabled. Pretty much stuff picked
up from FreeBSD 8.1

Looking at libdtrace code, there is this section in function "dt_module_update",

#if defined(__i386__)
    /*
     * Find the first load section and figure out the relocation
     * offset for the symbols. The kernel module will not need
     * relocation, but the kernel linker modules will.
     */
    for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) {

But the actual failure is because of faulty elf header...

#2  0xc822bb02 in abort () from /usr/lib/libc.so.6
#3  0xc8205aea in __assert from /usr/lib/libc.so.6
#4  0xc812fbb4 in _libelf_getphdr (e=0xffefc4c4, ec=2) at
libelf_phdr.c:83               <<== The same is not getting passed
down, 'e' is now different and gibberish.
#5  0xc812c3ac in gelf_getphdr (e=0x805df80, index=0, ...) at
libelf/gelf_phdr.c:87  <<== The struct _Elf 'e' is sane
#6  0xc80ea26c in dt_module_update at dt_module.c:934

But the elf header read from the kernel module is sane.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEOAkMXo83s6OmdcLDz6-LiW2PZ9YZomLfVagd8-vM44sKZSWg>