From owner-freebsd-questions@freebsd.org Mon Aug 10 17:01:12 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD6593A85DE for ; Mon, 10 Aug 2020 17:01:12 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id 4BQMgC3gdKz4X4Q for ; Mon, 10 Aug 2020 17:01:11 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: by segfault.tristatelogic.com (Postfix, from userid 1237) id 27F024E67C; Mon, 10 Aug 2020 10:01:03 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-questions@freebsd.org Subject: GDB no workie? Permission problem? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <62604.1597078863.1@segfault.tristatelogic.com> Date: Mon, 10 Aug 2020 10:01:03 -0700 Message-ID: <62605.1597078863@segfault.tristatelogic.com> X-Rspamd-Queue-Id: 4BQMgC3gdKz4X4Q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rfg@tristatelogic.com designates 69.62.255.118 as permitted sender) smtp.mailfrom=rfg@tristatelogic.com X-Spamd-Result: default: False [-0.65 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.74)[-0.743]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tristatelogic.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.54)[-0.536]; NEURAL_HAM_SHORT(-0.08)[-0.076]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14051, ipnet:69.62.128.0/17, country:US]; SUBJECT_ENDS_QUESTION(1.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 17:01:12 -0000 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.)