From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10258 invoked by alias); 24 Feb 2009 02:25:29 -0000 Received: (qmail 10239 invoked by uid 22791); 24 Feb 2009 02:25:28 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.188) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Feb 2009 02:25:23 +0000 Received: by ti-out-0910.google.com with SMTP id y8so1835127tia.12 for ; Mon, 23 Feb 2009 18:25:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.110.103.16 with SMTP id a16mr6986305tic.3.1235442320997; Mon, 23 Feb 2009 18:25:20 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Feb 2009 02:25:00 -0000 Message-ID: Subject: Re: problem remote debugging From: teawater To: Brendan Miller Cc: 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/msg00147.txt.bz2 On Tue, Feb 24, 2009 at 08:59, 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. > > In the example below, I am trying to remote debug a fairly complicated > service that has it's own user "a_user". > > On the remote machine I start gdbserver with: > > sudo -u a_user gdbserver host:4000 my_binary > > On the local machine I run: > gdb my_binary > > Then within gdb I type: > > target remote my_remote_machine:4000 Are you sure connect to my_remote_machine:4000 is OK? > run > > Then I get the "failed to open file error" followed by a segfault. > > On the other hand if I run this on the remote machine: > sudo -u a_user gdb my_binary > run > > everything is fine. > > Is one of my steps for remote debugging wrong? Would permissions be > different under remote debugging for some reason, and that would > explain why I can't open that file under remote debugging? > > The service I"m trying to debug is heavily multithreaded, if that > makes a difference. >