linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gdb/ptrace problem
@ 2001-05-17 11:46 Stanislav Malyshev
  2001-06-05  3:39 ` Mike Coleman
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Malyshev @ 2001-05-17 11:46 UTC (permalink / raw)
  To: linux-kernel

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.

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.115




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb/ptrace problem
  2001-05-17 11:46 gdb/ptrace problem Stanislav Malyshev
@ 2001-06-05  3:39 ` Mike Coleman
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Coleman @ 2001-06-05  3:39 UTC (permalink / raw)
  To: Stanislav Malyshev; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-05  3:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-17 11:46 gdb/ptrace problem Stanislav Malyshev
2001-06-05  3:39 ` Mike Coleman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).