ld.so assertion failure when using raw-dylib on Linux
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried the raw-dylib feature in https://github.com/fortanix/rust-sgx/pull/804 but unfortunately I couldn't get it to work. I'm getting this error when doing cargo run -p fortanix-sgx-tools --bin ftxsgx-runner.
Inconsistency detected by ld.so: rtld.c: 2013: dl_main: Assertion `GL(dl_rtld_map).l_prev->l_next == GL(dl_rtld_map).l_next' failed!
This is on Ubuntu 24.04 with libc 2.39-0ubuntu8.5. rustc 1.89.0-nightly (d4e1159b8 2025-06-21).
There are no major differences in objdump -P (just the ordering of DT_NEEDED entries is different, but I don't think that should matter?). There is a small difference in objdump -T:
--- objdump-T.fake-vdso
+++ objdump-T.raw-dylib
-0000000000000000 w DF *UND* 0000000000000000 Base __vdso_sgx_enter_enclave
+0000000000000000 w D *UND* 0000000000000000 Base __vdso_sgx_enter_enclave
I don't know that this is related to the assertion failure, but it's a bit surprising to me the F flag isn't getting set using the new method. I'm using extern { fn ... } in addition to using .type ..., function in assembly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with cargo run -p fortanix-sgx-tools --bin ftxsgx-runner on Ubuntu 24.04 using the reported nightly, then inspect the generated artifacts with objdump -P and objdump -T. Compare the fake-vDSO and raw-dylib cases, including DT_NEEDED ordering, symbol flags, the extern declaration, and the assembly .type directive. Done means identifying the cause of the ld.so assertion and validating a specific correction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- compilers, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100