!LemuOOvbWqRXodtSsw:nixos.org

NixOS Reproducible Builds

543 Members
Report: https://reproducible.nixos.org Project progress: https://github.com/orgs/NixOS/projects/30122 Servers

Load older messages


SenderMessageTime
5 Sep 2021
@zhaofeng:zhaofeng.liZhaofeng Li Ok, I looked at the logs a bit closer, and it looks like the NSS loading hack didn't really work. getaddrinfo doesn't seem to load libnss_dns 20:04:58
@zhaofeng:zhaofeng.liZhaofeng LiIt opens a socket to nscd and doesn't load libnss_dns at all.20:05:32
@rick:matrix.ciphernetics.nlRick (Mindavi)I'm also using different filesystems for / and for /nix/store20:05:48
@zhaofeng:zhaofeng.liZhaofeng LiSo when the builder runs it's already sandboxed and won't be able to load in the library20:05:55
@zhaofeng:zhaofeng.liZhaofeng Li * So when the builder calls libcurl it's already sandboxed and won't be able to load in the library20:06:23
@baloo_:matrix.orgbalooyup, that would make sense.20:06:27
@baloo_:matrix.orgbaloo
[pid 137783] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 12
[pid 137783] connect(12, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0
[pid 137783] sendto(12, "\2\0\0\0\16\0\0\0000\0\0\0this.pre-initializes.the.dns.resolvers.invalid.\0", 60, MSG_NOSIGNAL, NULL, 0) = 60
[pid 137783] poll([{fd=12, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=12, revents=POLLIN}])
[pid 137783] read(12, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 24) = 24
[pid 137783] close(12)                  = 0

here (where it works), and similar on your log

20:08:35
@zhaofeng:zhaofeng.liZhaofeng LiI think it's actually a bug that it worked with / and /nix/store in the same filesystem. It shouldn't have worked with the sandbox.20:09:57
@baloo_:matrix.orgbaloo
In reply to @zhaofeng:zhaofeng.li
I think it's actually a bug that it worked with / and /nix/store in the same filesystem. It shouldn't have worked with the sandbox.
I think so too.
20:10:13
@zhaofeng:zhaofeng.liZhaofeng LiSo it seems we need a better hack to pull in libnss20:10:16
@baloo_:matrix.orgbalooI have to run, but I'll have a look at it a bit later20:10:42
@baloo_:matrix.orgbaloothank you so much for the log!20:10:51
6 Sep 2021
@baloo_:matrix.orgbalooI think I found an ... ugly fix22:59:46
@baloo_:matrix.orgbaloo
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stddef.h>

void preloadNSS() {
        struct addrinfo *res = NULL;

        char * previous_env = getenv("LOCALDOMAIN");
        setenv("LOCALDOMAIN", "invalid", 1);
        if (getaddrinfo("this.pre-initializes.the.dns.resolvers.invalid.", "http", NULL, &res) != 0) {
            if (res) freeaddrinfo(res);
        }
        if (previous_env)
             setenv("LOCALDOMAIN", previous_env, 1);
        else
             unsetenv("LOCALDOMAIN");
}

int main() {
    preloadNSS();
}

This forces nss to make a dns lookup, and to load the nss_dns.so

23:03:27
@baloo_:matrix.orgbaloo(ugly because, I need to change the environment, so there is a slight delay during which it gets modified)23:04:36
@baloo_:matrix.orgbalooanyone willing to try a proper patch? :D23:06:13
@baloo_:matrix.orgbalooI still don't have a proper reproduction environment23:06:24
@baloo_:matrix.orgbaloohttps://github.com/NixOS/nix/pull/522423:20:14
7 Sep 2021
@baloo_:matrix.orgbalooso the single filesystem theory does not hold, the tests vms have a layout like:01:20:19
@baloo_:matrix.orgbaloo
client # /dev/vda on / type ext4 (rw,relatime)
client # store on /nix/.ro-store type 9p (rw,relatime,dirsync,loose,access=client,trans=virtio)
client # tmpfs on /nix/.rw-store type tmpfs (rw,relatime,mode=755)
client # shared on /tmp/shared type 9p (rw,relatime,sync,dirsync,access=client,trans=virtio)
client # xchg on /tmp/xchg type 9p (rw,relatime,sync,dirsync,access=client,trans=virtio)
client # overlay on /nix/store type overlay (rw,relatime,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/store,workdir=/mnt-root/nix/.rw-store/work)
client # overlay on /nix/store type overlay (ro,relatime,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/store,workdir=/mnt-root/nix/.rw-store/work)
01:20:38
@baloo_:matrix.orgbaloo

interestingly, my nix-daemon does mount

[pid 42542] mount("/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47", "/nix/store/r4rn52pvm83frvq2q4a2zb3vdq73l5x2-example.com.drv.c
hroot/nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47", 0x7f833016bef1, MS_BIND|MS_REC, NULL) = 0
01:28:31
@baloo_:matrix.orgbaloowhich explains why I do not see the bug01:28:38
@baloo_:matrix.orgbaloohaha01:35:46
@baloo_:matrix.orgbalooI can reproduce01:35:49
@baloo_:matrix.orgbaloo!01:35:51
@baloo_:matrix.orgbaloo
01:36:07
@baloo_:matrix.orgbaloo *
-  boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
+  #boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
01:36:18
@baloo_:matrix.orgbaloothis breaks fetchurl for me01:36:26
@tomberek:matrix.orgtomberekthat is odd02:56:36
@baloo_:matrix.orgbalooyou tell me about it03:02:22

There are no newer messages yet.


Back to Room ListRoom Version: 6