Bug 1246467 - cdtdebug: in F22, YAMA disallows ptrace, gdb attach fails and the CDT UI does not report that to user
Summary: cdtdebug: in F22, YAMA disallows ptrace, gdb attach fails and the CDT UI does...
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: eclipse-cdt
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Johnston
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-24 12:05 UTC by Michael Stahl
Modified: 2016-07-19 17:09 UTC (History)
5 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2016-07-19 17:09:38 UTC


Attachments (Terms of Use)

Description Michael Stahl 2015-07-24 12:05:14 UTC
Description of problem:

in Fedora 22, YAMA disallows ptrace, gdb attach fails and the CDT UI does not report that to user.

Version-Release number of selected component (if applicable):

gdb-7.9.1-17.fc22.x86_64
eclipse-platform-4.4.2-6.fc22.x86_64
eclipse-cdt-parsers-8.6.0-2.fc22.x86_64
eclipse-valgrind-3.2.0-1.fc22.noarch
eclipse-jdt-4.4.2-6.fc22.x86_64
eclipse-cdt-8.6.0-2.fc22.x86_64
eclipse-linuxtools-3.2.0-1.fc22.noarch

How reproducible:

by default in Fedora 22, YAMA disallows ptrace:

  > cat /proc/sys/kernel/yama/ptrace_scope
  1

Steps to Reproduce:
1. run "cdtdebug"
2. hit F11 to debug
3. select some process running under your UID to attach

Actual results:

attaching to process silently fails.

only if you switch to the "GDB traces" console you can see this:
  384,219 18-target-attach --thread-group i1 6638
  384,220 18^error,msg="ptrace: Operation not permitted."


Expected results:

Qt Creator handles this failure better, it pops up a dialog that says:

  ptrace: Operation not permitted.

  Could not attach to the process. Make sure no other debugger traces this process.
  If your uid matches the uid
  of the target process, check the settings of
  /proc/sys/kernel/yama/ptrace_scope
  For more details, see /etc/sysctl.d/10-ptrace.conf

Additional info:

there is a bug about the YAMA default setting:

https://bugzilla.redhat.com/show_bug.cgi?id=1209492

Comment 1 Roland Grunberg 2015-07-24 14:18:26 UTC
This was also reported as Bug 1245759 , which depends on the top-level bug for this. The fact that this fails silently is a bug, and a nice error message would go a long way.

Comment 2 Fedora End Of Life 2016-07-19 17:09:38 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.