public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Coleman <mkc@mathdogs.com>
To: Stanislav Malyshev <stas@zend.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: gdb/ptrace problem
Date: 04 Jun 2001 22:39:21 -0500	[thread overview]
Message-ID: <87ae3nlhna.fsf@mathdogs.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0105171443050.4567-100000@shire.zend.office>
In-Reply-To: <Pine.LNX.4.33.0105171443050.4567-100000@shire.zend.office>

Stanislav Malyshev <stas@zend.com> writes:
> Since installing 2.2.19, I have the following problem: each time I try to
> attach to a running program with gdb, the result is:
> 
> ptrace: Operation not permitted.
> 
> and attaching fails. No problem with 2.2.18. Have I missed something? Any
> advice on how this can be fixed?
> 
> gdb version:
> GNU gdb 5.0
> Copyright 2000 Free Software Foundation, Inc.

I did a cursory look throught the 18->19 patch and didn't see anything obvious
that could be causing this.  Are you talking about an i386 box?  Are you
running any other special patches on it?

You could try running gdb itself under strace.  Perhaps this will show some
info on exactly how this ptrace call is failing.

The EPERM would suggest that gdb doesn't have permission to attach.  You can't
attach to setuid/setgid processes unless you're root.  Otherwise, you can
generally attach to processes you're allowed to send signals to (unless
something has changed).  So you could try running gdb as root as see if you
can attach then.  Or, you could try doing a 'kill -STOP' on the process
instead of attaching to it.  Does it work?

Also, check for operator error.  :-)

--Mike

-- 
Mike Coleman, mkc@mathdogs.com
  http://www.mathdogs.com -- problem solving, expert software development

      reply	other threads:[~2001-06-05  3:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-17 11:46 gdb/ptrace problem Stanislav Malyshev
2001-06-05  3:39 ` Mike Coleman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ae3nlhna.fsf@mathdogs.com \
    --to=mkc@mathdogs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stas@zend.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox