From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 25 21:56:02 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBCBB1065672 for ; Mon, 25 Jun 2012 21:56:02 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 42DCF8FC0A for ; Mon, 25 Jun 2012 21:56:02 +0000 (UTC) Received: by lbon10 with SMTP id n10so8687572lbo.13 for ; Mon, 25 Jun 2012 14:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=j6gJJDi5BMtt4sSImghL8DedMDRIKHi6J63zaiHPBeE=; b=cLzQjiCY7qEjl0m7WGSYDd2ku6djV2ha+JdGmvimOkscZ6i5Dn2Jyf97UFeVaw9KXq pDTVgaxyA6fsN1c3u18kSc1XUBrBIebvV9sA08ikEAawRDBCWxzC2e3NXLryJmLsFiF0 KjQuMeU3dngDW3zqe6xLO/B07AjRiiqm9Pa1zGT+fXuKVqi+agRD0qiY0pF061PzoEut 8qSXuhPnEgYiPz5TJmdJIZkr+j/m0eD11Aq3CVI9/9jrkwxU9nvabLcpBNVxbPuM2ZQg z/JlizExoaPzfu5Rh4wzpRv3af41N9ZuK24mYhAhSn+ve2A8XB3m6CBH3wobSyi+BwFV u/TQ== MIME-Version: 1.0 Received: by 10.152.144.99 with SMTP id sl3mr13584113lab.44.1340661361174; Mon, 25 Jun 2012 14:56:01 -0700 (PDT) Received: by 10.112.115.6 with HTTP; Mon, 25 Jun 2012 14:56:01 -0700 (PDT) Date: Tue, 26 Jun 2012 03:26:01 +0530 Message-ID: From: Shrikanth Kamath To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: DTrace 32 bit on 64 bit machine? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 21:56:02 -0000 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.