Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

[Bug] Compiled binaries fail to be loaded to recent RBPF #281

Closed
dmakarov opened this issue Aug 16, 2023 · 2 comments · Fixed by #284
Closed

[Bug] Compiled binaries fail to be loaded to recent RBPF #281

dmakarov opened this issue Aug 16, 2023 · 2 comments · Fixed by #284
Labels
bug Something isn't working

Comments

@dmakarov
Copy link
Collaborator

🐛 Bug

Attempts to load Solana Move compiler generated binary files to a recent version of RBPF fail with the error

"Loading executable failed: InvalidAccountData"

To reproduce

Run a Move compiler generated binary file in ledger-tool built from recent Solana monorepo tree

cargo run --manifest-path ledger-tool/Cargo.toml -- program run -e debugger -i move/language/tools/move-mv-llvm-compiler/tests/rbpf-tests/entry-point04.json -l test-ledger move/language/tools/move-mv-llvm-compiler/tests/rbpf-tests/entry-point01-build/output.so

Stack trace/error message

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Loading executable failed: InvalidAccountData"', ledger-tool/src/program.rs:385:6

Expected Behavior

Binary file is loaded and program is executed.

@dmakarov dmakarov added the bug Something isn't working label Aug 16, 2023
@dmakarov
Copy link
Collaborator Author

This error is triggered by long symbol names contained in dynamic symbol table of the generated binary file. The symbols are exported from rust standard library. The standard library is built into a library archive when move-native library is created. By default the linker exports all global symbols defined in libraries linked into a shared object file that the linker creates.

The resolution for this problem is to make rustc output symbols with hidden visibility by default. The issue will be resolved by upgrading to the version of Solana platform-tools.

@dmakarov
Copy link
Collaborator Author

This will be resolved when patched rust compiler is released in next platform-tools bundle
anza-xyz/rust#83

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant