succinctlabs / sp1

The fastest, most feature-complete zkVM for developers.
https://succinctlabs.github.io/sp1
Apache License 2.0
1.02k stars 334 forks source link

Running `sp1up` on Fedora39 gives a Segementation fault #1780

Closed utkarshdagoat closed 1 week ago

utkarshdagoat commented 2 weeks ago

Component

cargo prove CLI/sp1up

Have you ensured that all of these are up to date?

What version of SP1 SDK are you on?

No response

What version of the cargo prove CLI are you on?

No response

Operating System

Linux (Other)

Describe the bug

Os and Machine I am running fedora 39 , on a intel x86_64 (i5-11260H) I was following this installation guide and was trying to install toolchain with prebuilt binaries.

on running sp1up I get the following error

sp1up: installing SP1 (version latest, tag latest)
sp1up: downloading latest cargo-prove
################################################################################################################################ 100.0%
sp1up: installed - cargo-prove sp1 (41532ee 2024-11-07T23:15:04.098081577Z)
sp1up: installing rust toolchain
Successfully cleaned up ~/.sp1 directory.
Successfully created ~/.sp1 directory.
/home/utkarsh/.sp1/bin/sp1up: line 341: 106433 Segmentation fault      (core dumped) "$@"
sp1up: command failed: /home/utkarsh/.sp1/bin/cargo-prove prove install-toolchain

I ran valgrind on the command /home/utkarsh/.sp1/bin/cargo-prove prove install-toolchain if it is helpful you can find the whole output here valgrind-output.txt . as it is of 3000 lines here are some snippets which maybe mean something

==109308== Conditional jump or move depends on uninitialised value(s)
==109308==    at 0x143B00E: getrandom (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x13BDB75: ptmalloc_init.part.0 (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x13C0964: malloc (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1422CDA: _dl_get_origin (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142BB86: _dl_non_dynamic_init (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142DBE9: __libc_init_first (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1399D81: (below main) (in /home/utkarsh/.sp1/bin/cargo-prove)
...

==109308== Thread 12 tokio-runtime-w:
==109308== Jump to the invalid address stated on the next line
==109308==    at 0x27FC0: ???
==109308==    by 0x146A07D: call_init.part.0 (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x146A167: _dl_init (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A0E4: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1421BAD: dl_open_worker (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A087: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1421F0A: _dl_open (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A305: do_dlopen (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A087: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A152: _dl_catch_error (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A483: __libc_dlopen_mode (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1410084: module_load (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==  Address 0x27fc0 is not stack'd, malloc'd or (recently) free'd

...
==109308== Conditional jump or move depends on uninitialised value(s)
==109308==    at 0x2ABCFE: std::sys::thread_local::native::lazy::Storage<T,D>::initialize (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2AB2E4: parking_lot::raw_mutex::RawMutex::lock_slow (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x125783C: tokio::runtime::blocking::pool::Spawner::spawn_task (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1256D32: tokio::runtime::blocking::pool::spawn_blocking (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x12678BD: tokio::runtime::scheduler::multi_thread::worker::Launch::launch (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1261FB7: tokio::runtime::builder::Builder::build (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x126BF74: tokio::runtime::runtime::Runtime::new (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2F0C87: sp1_cli::commands::install_toolchain::InstallToolchainCmd::run (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2B92D9: cargo_prove::main (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2BA132: std::sys::backtrace::__rust_begin_short_backtrace (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2BA08C: std::rt::lang_start::{{closure}} (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x13657CF: std::rt::lang_start_internal (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308== 
==109308== Conditional jump or move depends on uninitialised value(s)
==109308==    at 0x125F398: tokio::runtime::park::CachedParkThread::waker (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x30B724: tokio::runtime::park::CachedParkThread::block_on (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2CBD16: tokio::runtime::runtime::Runtime::block_on (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2F0D70: sp1_cli::commands::install_toolchain::InstallToolchainCmd::run (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2B92D9: cargo_prove::main (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2BA132: std::sys::backtrace::__rust_begin_short_backtrace (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2BA08C: std::rt::lang_start::{{closure}} (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x13657CF: std::rt::lang_start_internal (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x2BA074: main (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308== 

...

==109308== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==109308==  Bad permissions for mapped region at address 0x27FC0
==109308==    at 0x27FC0: ???
==109308==    by 0x146A07D: call_init.part.0 (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x146A167: _dl_init (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A0E4: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1421BAD: dl_open_worker (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A087: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1421F0A: _dl_open (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A305: do_dlopen (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A087: _dl_catch_exception (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A152: _dl_catch_error (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x142A483: __libc_dlopen_mode (in /home/utkarsh/.sp1/bin/cargo-prove)
==109308==    by 0x1410084: module_load (in /home/utkarsh/.sp1/bin/cargo-prove)
leruaa commented 1 week ago

@utkarshdagoat We will publish a release that fix this issue soon, but in the meantime as a workaround you can install SP1 with the following command:

SP1UP_VERSION=v3.0.1-alpha-b976ea6e sp1up

It will uses a (fixed) pre-release. Please lmk if it works.

utkarshdagoat commented 1 week ago
SP1UP_VERSION=v3.0.1-alpha-b976ea6e sp1up

Yup this works!

joske commented 1 week ago

@leruaa I don't think this item should be closed until you have a release that works. Then people having the same issue can find the workaround. I was bitten by this issue too (arch linux).