Re: sparc64 pbuilder/cowbuilder setup with qemu
I suggest reporting this as a QEMU bug first and they'll tell you
whether you're
at the right address or need to forward this to the kernel or glibc people.
Done: https://gitlab.com/qemu-project/qemu/-/issues/1394
I'll create an appropriate Debian bug when I have more information (i.e.
which package needs to be fixed).
I hacked apt (see below) to get around the issue and started what I was
originally trying to do:
https://buildd.debian.org/status/logs.php?pkg=nss&ver=2%3A3.85-1&arch=sparc64
Unfortunately, the "uname: Bad address" doesn't appear in qemu. Looks
like I'll have to debug this on the actual hardware after all.
Is this a known issue?
While trying to trace the libnss issue, I also encountered a crash in
g++, which I haven't been able to debug yet.
---
Quick fix for apt:
$ patch -p1 < getresuid-qemu-sparc64.patch
$ ninja libapt-pkg.so
$ cp apt-pkg/libapt-pkg.so.6.0.0
/usr/lib/sparc64-linux-gnu/libapt-pkg.so.6.0.0
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 10c656301..88b97ad0d 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -3360,6 +3360,7 @@ bool DropPrivileges()
/*{{{*/
uid_t suid = 0;
if (getresuid(&ruid, &euid, &suid))
return _error->Errno("getresuid", "Could not get saved
set-user-ID");
+ suid = suid >> 16;
if (suid != pw->pw_uid)
return _error->Error("Could not switch saved set-user-ID");
#endif
@@ -3371,6 +3372,7 @@ bool DropPrivileges()
/*{{{*/
gid_t sgid = 0;
if (getresgid(&rgid, &egid, &sgid))
return _error->Errno("getresuid", "Could not get saved
set-group-ID");
+ sgid = sgid >> 16;
if (sgid != pw->pw_gid)
return _error->Error("Could not switch saved set-group-ID");
#endif
Reply to: