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

SIGSEGV compiling stdweb, but only sometimes. #53083

Closed
Deedasmi opened this issue Aug 5, 2018 · 1 comment
Closed

SIGSEGV compiling stdweb, but only sometimes. #53083

Deedasmi opened this issue Aug 5, 2018 · 1 comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-wasm Target: WASM (WebAssembly), http://webassembly.org/

Comments

@Deedasmi
Copy link

Deedasmi commented Aug 5, 2018

Segfault happens randomly. While running cargo clean followed by building, and repeating both several times in a row may produce the segfault 20-40% of the time.

rustc 1.30.0-nightly (3edb355 2018-08-03)
cargo 1.29.0-nightly (15433e8cc 2018-08-02)
cargo-web 0.6.14
stdweb 0.4.8

cargo +nightly web build -p frontend --target wasm32-unknown-unknown --release --verbose

Running `rustc --crate-name stdweb /home/deedasmi/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.8/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="serde"' --cfg 'feature="serde_json"' -C metadata=c3b755290590b12c -C extra-filename=-c3b755290590b12c --out-dir /home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps -L dependency=/home/deedasmi/rust_game_server/target/release/deps --extern discard=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libdiscard-f41d7cf49758fa12.rlib --extern serde=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde-05998384e317ede7.rlib --extern serde_json=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde_json-dbb8443067c54392.rlib --extern stdweb_derive=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_derive-56fdba5ed79a1091.so --extern stdweb_internal_macros=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_internal_macros-254c9a45a2a50f67.so --cap-lints allow`
error: Could not compile `stdweb`.

Caused by:
  process didn't exit successfully: `rustc --crate-name stdweb /home/deedasmi/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.8/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="serde"' --cfg 'feature="serde_json"' -C metadata=c3b755290590b12c -C extra-filename=-c3b755290590b12c --out-dir /home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps -L dependency=/home/deedasmi/rust_game_server/target/release/deps --extern discard=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libdiscard-f41d7cf49758fa12.rlib --extern serde=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde-05998384e317ede7.rlib --extern serde_json=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde_json-dbb8443067c54392.rlib --extern stdweb_derive=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_derive-56fdba5ed79a1091.so --extern stdweb_internal_macros=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_internal_macros-254c9a45a2a50f67.so --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
error: build failed
rust_game_server|master⚡ ⇒ coredumpctl gdb
           PID: 25296 (rustc)
           UID: 1000 (deedasmi)
           GID: 985 (users)
        Signal: 11 (SEGV)
     Timestamp: Sun 2018-08-05 01:12:26 CDT (8min ago)
  Command Line: /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name stdweb /home/deedasmi/.cargo/registry/src/github.com-1ecc6299db9ec823/stdweb-0.4.8/src/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg feature="default" --cfg feature="serde" --cfg feature="serde_json" -C metadata=c3b755290590b12c -C extra-filename=-c3b755290590b12c --out-dir /home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -L dependency=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps -L dependency=/home/deedasmi/rust_game_server/target/release/deps --extern discard=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libdiscard-f41d7cf49758fa12.rlib --extern serde=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde-05998384e317ede7.rlib --extern serde_json=/home/deedasmi/rust_game_server/target/wasm32-unknown-unknown/release/deps/libserde_json-dbb8443067c54392.rlib --extern stdweb_derive=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_derive-56fdba5ed79a1091.so --extern stdweb_internal_macros=/home/deedasmi/rust_game_server/target/release/deps/libstdweb_internal_macros-254c9a45a2a50f67.so --cap-lints allow
    Executable: /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (deedasmi)
       Boot ID: a72bdd8af7e8491ca087be0226ab5d68
    Machine ID: 07cf691655e3459b9e4648ae9b6b5a11
      Hostname: lappy
       Storage: /var/lib/systemd/coredump/core.rustc.1000.a72bdd8af7e8491ca087be0226ab5d68.25296.1533449546000000.lz4
       Message: Process 25296 (rustc) of user 1000 dumped core.
                
                Stack trace of thread 25339:
                #0  0x00007f58c0f787b6 n/a (/home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so)

GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc...(no debugging symbols found)...done.
[New LWP 25339]
[New LWP 25334]
[New LWP 25338]
[New LWP 25296]
[New LWP 25337]
[New LWP 25340]
[New LWP 25335]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f58c0f787b6 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
[Current thread is 1 (Thread 0x7f58a77ff700 (LWP 25339))]
(gdb) bt
#0  0x00007f58c0f787b6 in llvm::scc_iterator<llvm::CallGraph*, llvm::GraphTraits<llvm::CallGraph*> >::DFSVisitOne(llvm::CallGraphNode*) ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00007f58c1c4dfa1 in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00007f58c1f6b01e in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00007f58c1eed026 in LLVMRunPassManager ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00007f58c072c34b in rustc_codegen_llvm::back::write::execute_work_item ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00007f58c06ef82e in std::sys_common::backtrace::__rust_begin_short_backtrace ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00007f58c06f1228 in std::panicking::try::do_call ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00007f58caca476a in __rust_maybe_catch_panic () at libpanic_unwind/lib.rs:105
#8  0x00007f58c06f8e21 in <F as alloc::boxed::FnBox<A>>::call_box ()
   from /home/deedasmi/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00007f58cac6a05b in _$LT$alloc..boxed..Box$LT$$LP$dyn$u20$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$RP$$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h7ba473a7a0770ee0 () at /checkout/src/liballoc/boxed.rs:652
#10 std::sys_common::thread::start_thread () at libstd/sys_common/thread.rs:24
#11 0x00007f58cac66326 in std::sys::unix::thread::Thread::new::thread_start () at libstd/sys/unix/thread.rs:90
#12 0x00007f58c4eb8075 in start_thread () from /usr/lib/libpthread.so.0
#13 0x00007f58ca94953f in clone () from /usr/lib/libc.so.6
(gdb) 
@kennytm kennytm added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. C-bug Category: This is a bug. labels Aug 5, 2018
@alexcrichton
Copy link
Member

Quite a few changes have happened to the wasm backend in the meantime since this was opened, so I'm going to close this as "likely fixed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-wasm Target: WASM (WebAssembly), http://webassembly.org/
Projects
None yet
Development

No branches or pull requests

3 participants