Re: attaching a process in eclipse

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Ravi Kiran <ravi(dot)kolanpaka(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: attaching a process in eclipse
Date: 2014-12-28 10:54:12
Message-ID: 549FE154.8050602@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-12-28 10:56:04 Re: attaching a process in eclipse
Previous Message Ravi Kiran 2014-12-28 10:37:30 attaching a process in eclipse