Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2020 10:01:03 -0700
From:      "Ronald F. Guilmette" <rfg@tristatelogic.com>
To:        freebsd-questions@freebsd.org
Subject:   GDB no workie?  Permission problem?
Message-ID:  <62605.1597078863@segfault.tristatelogic.com>

next in thread | raw e-mail | index | archive | help
Just ran gdb, which I haven't done for awhile, to find a small
bug in one of my own C programs.

Set two breakpoints successfully and then tried to r(un) the
program to be debugged.  (This was all being done under my
own personal non-priviliged account.)

Immediately got something very unexpected:

    warning: Could not trace the inferior process.
    Error: 
    warning: ptrace: Operation not permitted
    During startup program exited with code 127.

I su'd to root and tried again, and of course now it works.

So, um, what the hay? What goes on here?

I seem to vaguely recall some "security" options being presented
at system install time, and I do believe one of these had to do
with ptrace.  So I guess that I must have made the Wrong Choice
with respect to that one. OK. Fine.  Now how do I fix that misake
on my part, short of re-installing the whole bloody system?

(I'm looking at the man page for ptrace(2) and it is not helpful
on this question.)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?62605.1597078863>