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

🐛 Dynamic linking failure under newer tally VM versions #359

Closed
hacheigriega opened this issue Sep 11, 2024 · 1 comment · Fixed by #358
Closed

🐛 Dynamic linking failure under newer tally VM versions #359

hacheigriega opened this issue Sep 11, 2024 · 1 comment · Fixed by #358
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@hacheigriega
Copy link
Member

🐛 Bug Report

During the upgrade of the Tally VM from version v1.1.0 to v1.1.2 in PR #358, we encountered a dynamic linking issue where the dynamic library file was not properly configured at compile time, leading to a runtime error. This issue seems to be confined to x86 machines. Upon executing the binary built with tally VM v1.1.2, we get:

$ sedad
./build/sedad: error while loading shared libraries: libseda_tally_vm.so: cannot open shared object file: No such file or directory

Examining the dynamically linked libraries of the binaries:

# hy/tally-vm-update branch (on x86 machine, gcc compiler)
$ ldd ./build/sedad
libseda_tally_vm.so => not found

# main branch (on x86 machine, gcc compiler)
$ ldd ./build/sedad
	libseda_tally_vm.x86_64.so => /home/ec2-user/go/pkg/mod/github.com/sedaprotocol/seda-wasm-vm/tallyvm@v1.1.0/libseda_tally_vm.x86_64.so (0x00007fab51400000)

# hy/tally-vm-update branch (on Mac, clang compiler)
$ otool -L ./build/sedad      
./build/sedad:
        @rpath/libseda_tally_vm.dylib (compatibility version 0.0.0, current version 0.0.0)

From these outputs we can infer that the compiler is not processing the CGO directive corresponding to the architecture.

@hacheigriega hacheigriega added the type: bug 🐛 Something isn't working label Sep 11, 2024
@Thomasvdam
Copy link
Member

One thing I discovered was that building the WASM VM library files through the pipeline for 1.1.0 (last working version) and publishing those as tallyvm/1.1.0-test.1 also causes the linking to fail when used in the chain. See https://github.com/sedaprotocol/seda-chain/actions/runs/10827801114/job/30041756810

The main difference between the CI runs seems to be the Rust version:

Output from working build: https://github.com/sedaprotocol/seda-wasm-vm/actions/runs/10528635375/job/29174597277

Run dtolnay/rust-toolchain@stable
Run : parse toolchain version
Run : construct rustup command line
Run : set $CARGO_HOME
Run : install rustup if needed
Run rustup toolchain install stable --profile minimal --no-self-update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.80.1 (3f5fd8dd4 2024-08-06)

Run rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.80.1 (3f5fd8dd4 2024-08-06)

Run : create cachekey
Run : disable incremental compilation
Run : enable colors in Cargo output
Run : enable Cargo sparse registry
Run : work around spurious network errors in curl 8.0
Run rustc +stable --version --verbose
rustc 1.80.1 (3f5fd8dd4 2024-08-06)
binary: rustc
commit-hash: 3f5fd8dd41153bc5fdca9427e9e05be2c767ba23
commit-date: 2024-08-06
host: x86_64-unknown-linux-gnu
release: 1.80.1
LLVM version: 18.1.7

Output from failing build: https://github.com/sedaprotocol/seda-wasm-vm/actions/runs/10827528692/job/30040896627

Run dtolnay/rust-toolchain@stable
Run : parse toolchain version
Run : construct rustup command line
Run : set $CARGO_HOME
Run : install rustup if needed
Run rustup toolchain install stable --profile minimal --no-self-update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.81.0 (eeb90cda1 2024-09-04)

Run rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.81.0 (eeb90cda1 2024-09-04)

Run : create cachekey
Run : disable incremental compilation
Run : enable colors in Cargo output
Run : enable Cargo sparse registry
Run : work around spurious network errors in curl 8.0
Run rustc +stable --version --verbose
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

I will try setting the Rust version to the one of the last working build.

Thomasvdam added a commit to sedaprotocol/seda-wasm-vm that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants