From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12528 invoked by alias); 24 Feb 2009 17:01:22 -0000 Received: (qmail 11269 invoked by uid 22791); 24 Feb 2009 17:01:20 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-ew0-f180.google.com (HELO mail-ew0-f180.google.com) (209.85.219.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Feb 2009 17:01:15 +0000 Received: by ewy28 with SMTP id 28so351755ewy.0 for ; Tue, 24 Feb 2009 09:01:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.210.132.3 with SMTP id f3mr349208ebd.43.1235494872121; Tue, 24 Feb 2009 09:01:12 -0800 (PST) In-Reply-To: <20090224023251.GA22085@caradoc.them.org> References: <20090224023251.GA22085@caradoc.them.org> Date: Tue, 24 Feb 2009 17:01:00 -0000 Message-ID: Subject: Re: problem remote debugging From: Brendan Miller To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-02/txt/msg00149.txt.bz2 On Mon, Feb 23, 2009 at 6:32 PM, Daniel Jacobowitz wrote: > On Mon, Feb 23, 2009 at 04:59:48PM -0800, Brendan Miller wrote: >> I'm having a problem with remote debugging where when debugging >> locally I will launch fine, but when remotely debugging my program >> will fail to open a certain text file, then segfault. >> >> Both the host and client are running x86 RHEL4. The gdb version is >> 6.3.0.0-1.153.el4rh. > > A frequent cause of this problem is different patch levels of > libraries installed on the two systems. If they don't exactly match, > you need a copy on the host of the target's libraries, and to use set > sysroot. Otherwise GDB may place internal breakpoints in the wrong > locations, leading to mayhem. I'm not sure if that makes sense. What happened was a file failed to be read, which to me implies different behavior given the same binaries executed on the same machine, depending on if in local or remote debugging mode. This was followed by a segfault which may or may not be related. I can see how the gdb client would crash if I didn't have the proper debugging symbols on the client, but could that really effect other behavior on the remote machine? I did originally copy over all .so's related to the service directly and included their path in LD_LIBRARY_PATH, although I may have a *slightly* different glibc or something. > > Also, this is a very old GDB - I always recommend trying the latest > (GDB and gdbserver). Is there a known bug that was fixed that would resolve this? That would be a lot of work, given that I have no newer RPM's and there isn't a compiler on my remote machine. I'll try it if there's a reason to think it would work, or if I run out of other ideas. This really looks to me like executable behavior is different under local and remote debugging, so I was hoping someone knowledgeable about GDB could comment on if that is possible, or if there are known bugs here. Things like mismatched symbols don't seem like they should effect runtime behavior on the remote machine.