NetBSD Problem Report #60826

From wiz@netbsd.org  Wed Sep 30 08:31:34 2026
Return-Path: <wiz@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CAA161A923B
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 30 Sep 2026 08:31:33 +0000 (UTC)
Message-Id: <20260930083133.4814C84D69@mail.netbsd.org>
Date: Wed, 30 Sep 2026 08:31:33 +0000 (UTC)
From: wiz@NetBSD.org
Reply-To: wiz@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: Linux emulation: ptrace support on x86_64 missing
X-Send-Pr-Version: 3.95
X-From4GNATS: "wiz@NetBSD.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60826
>Category:       kern
>Synopsis:       Linux emulation: ptrace support on x86_64 missing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 30 08:35:00 +0000 2026
>Originator:     Thomas Klausner
>Release:        NetBSD 11.99.8
>Organization:

>Environment:
Architecture: x86_64
Machine: amd64
>Description:
When running wip/suse15_gdb's /emul/linux/usr/bin/gdb on a Linux
x86_64 binary, one gets:

--- begin ---
(gdb) r
Starting program: /usr/pkg/emul/linux/usr/bin/gcc-12
[ 2678745.9401125] linux_sys_rt_sigaction: setting signal 64 ignored
Couldn't get registers: Input/output error.
(gdb)
--- end ---

I'm not sure about the first warning, but the second is caused
by /usr/src/sys/compat/linux/common/linux_ptrace.h:

#if defined(__i386__) || defined (__powerpc__) || defined (__mips__) || \
    defined(__arm__)
struct linux_sys_ptrace_args;
int linux_sys_ptrace_arch(struct lwp *, const struct linux_sys_ptrace_args *, register_t *);

#define LINUX_SYS_PTRACE_ARCH(l,v,r)    linux_sys_ptrace_arch((l),(v),(r))
#else
#define LINUX_SYS_PTRACE_ARCH(l,v,r)    EIO
#endif

i.e., on x86_64 in particular, linux_sys_ptrace_arch returns is not implemented.

Using the native gdb is not an option either:

--- begin ---
$ gdb /emul/linux/usr/bin/gcc-12
...
warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
of GDB.  Attempting to continue with the default i386:x86-64 settings.

Reading symbols from /emul/linux/usr/bin/gcc-12...
(No debugging symbols found in /emul/linux/usr/bin/gcc-12)
(gdb) br main
Function "main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (main) pending.
(gdb) r
Starting program: /usr/pkg/emul/linux/usr/bin/gcc-12
gcc-12: fatal error: no input files
compilation terminated.
[Inferior 1 (process 1955) exited with code 01]
--- end ---

>How-To-Repeat:
See above.
>Fix:
Yes please.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.