Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmemory_map.so not found when running ia2-sandbox as part of ninja check #472

Open
kkysen opened this issue Dec 2, 2024 · 1 comment

Comments

@kkysen
Copy link
Contributor

kkysen commented Dec 2, 2024

When running IA2 tests locally with ninja check, I keep getting errors like this on almost all of the tests:

/home/kkysen/work/rust/ia2/build/runtime/tracer/ia2-sandbox: error while loading shared libraries: libmemory_map.so: cannot open shared object file: No such file or directory

ldd also indicates libmemory_map.so is not found in ia2-sandbox:

❯ ldd build/runtime/tracer/ia2-sandbox
        linux-vdso.so.1 (0x00007ffe2f1c7000)
        libmemory_map.so => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000797256c00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000797256ec6000)

And ia2-sandbox also doesn't have any RPATH/RUNPATH:

❯ objdump -x build/runtime/tracer/ia2-sandbox | rg 'R.*PATH'

This is the command that's building ia2-sandbox:

cc -g runtime/tracer/CMakeFiles/ia2-sandbox.dir/start.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/seccomp_filter.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/track_memory_map.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/mmap_event.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/get_inferior_pkru.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/landlock.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/strv.c.o runtime/tracer/CMakeFiles/ia2-sandbox.dir/forbid_paths.c.o -o runtime/tracer/ia2-sandbox runtime/tracer//release/libmemory_map.so

I can work around this by setting LD_LIBRARY_PATH="$PWD/build/runtime/tracer/release/" ninja check.

This is still working in CI, but not locally (and reproducible locally by @fw-immunant). It also used to work locally, so we should hopefully be able to bisect to find where this broke.

@kkysen
Copy link
Contributor Author

kkysen commented Dec 4, 2024

I git bisected and tracked this down to 5828dee, which is when the ia2-sandbox runtime was added to tests, so I'm not sure this was ever working locally. Note that I did have to switch to LLVM 16 to bisect correctly, as a lot of old commits don't compile on LLVM 17 and 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant