NetBSD Problem Report #59355
From www@netbsd.org Sat Apr 26 05:16:12 2025
Return-Path: <www@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 "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 0F6471A9239
for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Apr 2025 05:16:12 +0000 (UTC)
Message-Id: <20250426051610.825BA1A923C@mollari.NetBSD.org>
Date: Sat, 26 Apr 2025 05:16:10 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: mips64: rump.netstat can't talk to rump_server
X-Send-Pr-Version: www-1.0
>Number: 59355
>Category: port-mips
>Synopsis: mips64: rump.netstat can't talk to rump_server
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-mips-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 26 05:20:00 +0000 2025
>Originator: Taylor R Campbell
>Release: current, 10, 9, ...
>Organization:
The N32BSD Rumination
>Environment:
>Description:
On mips64, rump_server is built as n32, just like most userland executables.
But rump.netstat is built as n64, just like netstat and a handful of other userland executables that use kvm to examine n64ish kernel guts.
And rump doesn't know anything about non-native process emul, so an n32 rump_server will interpret the client's syscalls as n32 syscalls, and an n64 rump.netstat will send n64 syscalls to the server.
It ends up in something like this (not sure exactly why):
9271 9271 rump.netstat 0.000120998 CALL read(3,0xfff866c000,8)
9271 9271 rump.netstat 0.000021728 GIO fd 3 read 8 bytes
"\0\0\0\^D\M^?\M^?wX"
9271 9271 rump.netstat 0.000004170 RET read 8, 24/0x18
9271 9271 rump.netstat 0.000006962 CALL sendmsg(3,0xffffff71b0,0x400)
9271 9271 rump.netstat 0.000006094 MISC msghdr: [name=0x0, namelen=0, iov=0xffffff7480, iovlen=2, control=0x0, controllen=0, flags=4000000]
9271 9271 rump.netstat 0.000030478 RET sendmsg -1 errno 14 Bad address
9271 9271 rump.netstat 0.000049254 CALL __kevent100(4,0,0,0xffffff7240,8,0)
And it hangs, so the tests that involve rump.netstat all time out.
>How-To-Repeat:
cd /usr/tests/net/if_gif
atf-run | atf-report
>Fix:
Yes, please!
Maybe the rump server should be taught to handle non-native emul:
https://nxr.netbsd.org/xref/src/sys/rump/kern/lib/libsysproxy/sysproxy.c?r=1.10#84
Might require inventing some way for the client and server to negotiate process emul choice.
Or, maybe rump.netstat should be built as n32 (the kvm parts won't work anyway with an n32 rump_server), but that might be annoying to work into the same Makefile as netstat.
Or, maybe rump_server should be built as n64, but that cause the opposite problem for various other things that do not involve rump.netstat.
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.