From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24058 invoked by alias); 31 May 2009 04:51:56 -0000 Received: (qmail 24042 invoked by uid 22791); 31 May 2009 04:51:55 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f175.google.com (HELO mail-pz0-f175.google.com) (209.85.222.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 31 May 2009 04:51:48 +0000 Received: by pzk5 with SMTP id 5so6967528pzk.12 for ; Sat, 30 May 2009 21:51:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.110.26.8 with SMTP id 8mr98261tiz.46.1243745505938; Sat, 30 May 2009 21:51:45 -0700 (PDT) In-Reply-To: <1243457555.17311.4.camel@localhost.localdomain> References: <1243457555.17311.4.camel@localhost.localdomain> Date: Sun, 31 May 2009 04:51:00 -0000 Message-ID: Subject: Re: examining a core dump on a machine with other base addresses in shared libraries From: Hui Zhu To: Drago Krznaric Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00204.txt.bz2 I think you can copy the share lib in A to B, and call command "set sysroot dirname" in gdb to let gdb know wich directory it can find right lib in B. Hui On Thu, May 28, 2009 at 04:52, Drago Krznaric wro= te: > Hi, > > I have a program and a core dump created on machine A that I copy to > machine B. I can open the core dump and get a nice backtrace on A but > not on B. The reason appears to be that the shared libraries on A and B > have different base addresses. They are otherwise exactly identical in > hardware and software (RedHat 4). I guess that the addresses are > different because of the prelink cron job or "address space layout > randomization". Normally I don't have access to machine A, so I would > really want to open the core dump on B without having to copy all used > shared libraries from A to B. > > Does anybody know if and how this can be done? > > When opening core dump with gdb-6.8 on B machine, I get something like: > > warning: .dynamic section for "/usr/lib/libstdc++.so.6" is not at the > expected address (wrong library or version mismatch?) > warning: .dynamic section for "/lib/tls/libm.so.6" is not at the > expected address > warning: difference appears to be caused by prelink, adjusting > expectations > ... > > and when I do a backtrace I get something useless as: > > #0 =A00x003d17a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 > #1 =A00x004117d5 in __longjmp () from /lib/tls/libc.so.6 > #2 =A00x00000000 in ?? () > (gdb) > > Thanks in advance, > Drago > >