Yes, and it doesn't matter whether you use the interpreter from the build directory or the default one (the binary has PF_INTERP set to /lib/ld-linux-aarch64.so.1 but the testsuite invokes it with the one from the build tree).
Some gdb time later, it transpires that this is systemd's fault :) (at least partially)
I'm a bit hazy on NSS in general, but valid uids present in /etc/passwd are (I assume) found by the "compat" nss module. Ones that are not found there are sent off to the libnss-systemd.so.
In there, _nss_systemd_getpwuid_r calls userdb_getpwuid which calls userdb_nss_compat_is_enabled which calls userdb_thread_sockaddr which calls getauxval(AT_RANDOM) which for some reason in this situation _fails_. userdb_thread_sockaddr then returns -EIO which leads to userdb_getpwuid setting errnop to EIO and returning NSS_STATUS_UNAVAIL which leads to _nss_systemd_getpwuid_r setting its errnop to EIO and that's what the test program sees as errno.
Yes, and it doesn't matter whether you use the interpreter from the build directory or the default one (the binary has PF_INTERP set to /lib/ld- linux-aarch64. so.1 but the testsuite invokes it with the one from the build tree).
Some gdb time later, it transpires that this is systemd's fault :) (at least partially)
I'm a bit hazy on NSS in general, but valid uids present in /etc/passwd are (I assume) found by the "compat" nss module. Ones that are not found there are sent off to the libnss-systemd.so.
In there, _nss_systemd_ getpwuid_ r calls userdb_getpwuid which calls userdb_ nss_compat_ is_enabled which calls userdb_ thread_ sockaddr which calls getauxval( AT_RANDOM) which for some reason in this situation _fails_. userdb_ thread_ sockaddr then returns -EIO which leads to userdb_getpwuid setting errnop to EIO and returning NSS_STATUS_UNAVAIL which leads to _nss_systemd_ getpwuid_ r setting its errnop to EIO and that's what the test program sees as errno.
This leads me to this experiment:
ubuntu@ juju-b11c42- ubuntu- 24:~$ cat getauxval.c
#include <sys/auxv.h>
#include <stdio.h>
int main(int argc, char** argv) {
printf( "%lu\n" , getauxval( AT_RANDOM) ); juju-b11c42- ubuntu- 24:~$ gcc -o getauxval getauxval.c juju-b11c42- ubuntu- 24:~$ ./getauxval juju-b11c42- ubuntu- 24:~$ /lib/ld- linux-aarch64. so.1 ./getauxval
}
ubuntu@
ubuntu@
281474825715272
ubuntu@
0
which seems like a bug (it doesn't happen on amd64 or s390x).