Skip to content

ld.so assertion failure when using raw-dylib on Linux #145854

@jethrogb

Description

@jethrogb

I tried the raw-dylib feature in fortanix/rust-sgx#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 (d4e1159 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.F-raw_dylib`#![feature(raw_dylib)]`O-linuxOperating system: Linuxneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions