sfackler / rust-openssl

OpenSSL bindings for Rust
1.38k stars 742 forks source link

Segmentation fault on manjaro (arch) #2280

Closed leo91000 closed 1 month ago

leo91000 commented 1 month ago

Hello,

When I try to use cargo install dioxus-cli which depend on openssl-sys I get a segfault error when trying to compile :

  --- stderr
  during RTL pass: sched2
  crypto/ec/curve25519.c: In function 'table_select':
  crypto/ec/curve25519.c:4222:1: internal compiler error: Segmentation fault
   4222 | }
        | ^
  0x1fab306 internal_error(char const*, ...)
        ???:0
  0x1dd2feb sched_insns_conditions_mutex_p(rtx_insn const*, rtx_insn const*)
        ???:0
  0x1dd8ea2 deps_analyze_insn(deps_desc*, rtx_insn*)
        ???:0
  0x1dd9622 sched_analyze(deps_desc*, rtx_insn*, rtx_insn*)

        ???:0
  0xd5a44c sched_rgn_compute_dependencies(int)
        ???:0
  Please submit a full bug report, with preprocessed source (by using -freport-bug).
  Please include the complete backtrace with any bug report.
  See <https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues> for instructions.
  make[1]: *** [Makefile:7113: crypto/ec/libcrypto-lib-curve25519.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make: *** [Makefile:2326: build_libs] Error 2
  thread 'main' panicked at /home/leoc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-300.3.1+3.3.1/src/lib.rs:621:9:

  Error building OpenSSL:
      Command: cd "/tmp/cargo-installOf5Bv1/release/build/openssl-sys-7363dca9ecf6b0e1/out/openssl-build/build/src" && MAKEFLAGS="-j --jobserver-fds=10,12 --jobserver-auth=10,12" "make" "build_libs"
      Exit status: exit status: 2

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I attached the full error log below in case it could be useful : logs.txt

sfackler commented 1 month ago

That looks like a crash in GCC, not rust-openssl.

leo91000 commented 1 month ago

Okay, thank you and sorry for the noise

leo91000 commented 1 month ago

For other users that might have this problem, I was compiling with gcc, and it didn't work for me. I installed clang and setup env variable so that it compiles with it :

export CC=clang
export CXX=clang++

And it worked