Re: attaching a process in eclipse - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: attaching a process in eclipse
Date
Msg-id 549FE154.8050602@2ndquadrant.com
Whole thread Raw
In response to attaching a process in eclipse  (Ravi Kiran <ravi.kolanpaka@gmail.com>)
List pgsql-hackers
On 12/28/2014 06:37 PM, Ravi Kiran wrote:
> 
> "Could not attach to process.  If your uid matches the uid of the target
> process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
> again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf"
> 
> how do we rectify this error?

At a guess, the PostgreSQL you are trying to attach to is not running
under the same user account as Eclipse.

The Linux kernel only permits you to attach to a process with the same
user account as you by default, unless you are the root user. That's
what "if your uid matches the uid of the target process" refers to.

You'll have the same issue when attaching using gdb directly, this isn't
an Eclipse issue.

If you were debugging manually with gdb you'd often do something like
   sudo -u postgres gdb -p thepid

to run gdb as the same user id as the target process. (Avoid running gdb
as root whenever possible). Perhaps Eclipse lets you configure a prefix
command for gdb so you can do that with Eclipse and passwordless sudo?

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Ravi Kiran
Date:
Subject: attaching a process in eclipse
Next
From: Craig Ringer
Date:
Subject: Re: attaching a process in eclipse