Skip to content

proc macro server crashed! #7045

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

Closed
junknet opened this issue Dec 26, 2020 · 13 comments
Closed

proc macro server crashed! #7045

junknet opened this issue Dec 26, 2020 · 13 comments
Labels
A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now

Comments

@junknet
Copy link

junknet commented Dec 26, 2020

OS: archlinux
image
image

This error occurs only on Linux!
Nothing wrong on Windows.

@bjorn3
Copy link
Member

bjorn3 commented Dec 26, 2020

What do the logs say? You can find it in the output pane. It is one of the options starting with "rust analyzer".

@jogramming
Copy link

I'm also having this issue on stable

thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:62:51
stack backtrace:
   0:     0x7fe6a4357987 - std::backtrace_rs::backtrace::libunwind::trace::h746c3e9529d524bc
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7fe6a4357987 - std::backtrace_rs::backtrace::trace_unsynchronized::h86340908ff889faa
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fe6a4357987 - std::sys_common::backtrace::_print_fmt::h43f85f9b18230404
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fe6a4357987 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc132ae1a5b5aa7cd
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7fe6a43cafac - core::fmt::write::hdf023a0036d2a25f
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/core/src/fmt/mod.rs:1078:17
   5:     0x7fe6a4349b02 - std::io::Write::write_fmt::h8580846154bcb66a
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/io/mod.rs:1519:15
   6:     0x7fe6a435b685 - std::sys_common::backtrace::_print::h7ee55fed88d107a3
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7fe6a435b685 - std::sys_common::backtrace::print::h54a7d3e52a524177
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7fe6a435b685 - std::panicking::default_hook::{{closure}}::h60921e857bf55a40
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:208:50
   9:     0x7fe6a435b1da - std::panicking::default_hook::hf0f9afb1017317fc
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:225:9
  10:     0x7fe6a406e846 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3cc9ac0a62f88aee
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/alloc/src/boxed.rs:1342:9
  11:     0x7fe6a4077bfb - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::h11f5a3b29dda0c18
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:320:21
  12:     0x7fe6a435bf86 - std::panicking::rust_panic_with_hook::h8d66bf42b407aaea
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:595:17
  13:     0x7fe6a435ba77 - std::panicking::begin_panic_handler::{{closure}}::hde71edcd925d0c5e
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:495:13
  14:     0x7fe6a4357e4c - std::sys_common::backtrace::__rust_end_short_backtrace::h8a3c7d6cea578919
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/sys_common/backtrace.rs:141:18
  15:     0x7fe6a435ba09 - rust_begin_unwind
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:493:5
  16:     0x7fe6a43c73c1 - core::panicking::panic_fmt::h20225113c4a2f8fd
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/core/src/panicking.rs:92:14
  17:     0x7fe6a43c730d - core::panicking::panic::h35b77276aa4b0c12
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/core/src/panicking.rs:50:5
  18:     0x7fe6a404f01c - core::option::Option<T>::unwrap::h54bf93eac68da79b
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/core/src/option.rs:386:21
  19:     0x7fe6a406ac2d - <proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::PutBackOnDrop<T> as core::ops::drop::Drop>::drop::h9d1558b37b7ce08d
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:62:33
  20:     0x7fe6a407b092 - core::ptr::drop_in_place::h168f20c5744374d5
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/core/src/ptr/mod.rs:179:1
  21:     0x7fe6a406a879 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::h7559a226a83fae86
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:76:5
  22:     0x7fe6a4077718 - proc_macro::bridge::client::BridgeState::with::{{closure}}::h8c68903219df10f8
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:291:13
  23:     0x7fe6a406b529 - std::thread::local::LocalKey<T>::try_with::hbe13cbd2b799acc5
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/thread/local.rs:272:16
  24:     0x7fe6a406af53 - std::thread::local::LocalKey<T>::with::h877aa17e9b135b28
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/thread/local.rs:248:9
  25:     0x7fe6a4077632 - proc_macro::bridge::client::BridgeState::with::h0573290f80c5efb3
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:290:9
  26:     0x7fe6a405b9d8 - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::hd63d41d5fc6ba8fa
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:329:9
  27:     0x7fe6a407739f - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::h9841cda49b13ced8
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:375:13
  28:     0x7fe6a406a0e8 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}::hb8af0b5eaa76d707
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:80:33
  29:     0x7fe6a406a2e5 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::h131a0b7afa35de66
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:75:9
  30:     0x7fe6a406a0c1 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::h58700fff6f55a935
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/scoped_cell.rs:80:9
  31:     0x7fe6a4077adf - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::h290decab42fd2dea
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:325:35
  32:     0x7fe6a406b0dd - std::thread::local::LocalKey<T>::try_with::h038c6090a65a1675
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/thread/local.rs:272:16
  33:     0x7fe6a406ae3d - std::thread::local::LocalKey<T>::with::h2ec691a2f0c7fa44
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/thread/local.rs:248:9
  34:     0x7fe6a405baad - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::hb91b185ad484ac46
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:325:9
  35:     0x7fe6a4077224 - proc_macro::bridge::client::run_client::{{closure}}::h76ff7ebc0bf115a8
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:370:9
  36:     0x7fe6a4069fd2 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h5df6a2de05b787d4
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panic.rs:322:9
  37:     0x7fe6a407a160 - std::panicking::try::do_call::h0b1b56a95f9ef3e8
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:379:40
  38:     0x7fe6a407e19d - __rust_try
  39:     0x7fe6a407a080 - std::panicking::try::ha9e18ce4add5a399
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panicking.rs:343:19
  40:     0x7fe6a406ade2 - std::panic::catch_unwind::h24435f3010f8ca8a
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/std/src/panic.rs:396:14
  41:     0x7fe6a407711c - proc_macro::bridge::client::run_client::hf6cebf074bb9d57b
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:369:5
  42:     0x7fe6a4077cd1 - proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run::h53bd9b9b160336ee
                               at /rustc/7efc097c4fe6e97f54a44cee91c56189e9ddb41c/library/proc_macro/src/bridge/client.rs:410:13
  43:     0x55f8c796fa48 - proc_macro_srv::proc_macro::bridge::server::run_server::h5ee9550ab5ee1902
  44:     0x55f8c7961c14 - proc_macro_srv::cli::run::h04ba2401482cac18
  45:     0x55f8c7929d5e - rust_analyzer::main::h03108b849acfca6a
  46:     0x55f8c79465c3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1ff5ed9d6d11628f
  47:     0x55f8c7946969 - std::rt::lang_start::{{closure}}::h42bd59eb70e1358f
  48:     0x55f8c8631ae7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he179d32a5d10d957
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/ops/function.rs:259:13
  49:     0x55f8c8631ae7 - std::panicking::try::do_call::hcb3d5e7be089b2b4
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:381:40
  50:     0x55f8c8631ae7 - std::panicking::try::h7ac93b0cd56fb701
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:345:19
  51:     0x55f8c8631ae7 - std::panic::catch_unwind::h7b40e396c93a4fcd
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panic.rs:382:14
  52:     0x55f8c8631ae7 - std::rt::lang_start_internal::h142b9cc66267fea1
                               at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/rt.rs:51:25
  53:     0x55f8c792c342 - main
  54:     0x7fe6ae530152 - __libc_start_main
  55:     0x55f8c78f49d9 - _start
  56:                0x0 - <unknown>
thread panicked while panicking. aborting.
[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(Some(ExitStatus(ExitStatus(132))))

@lnicola lnicola added A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now labels Dec 27, 2020
@edwin0cheng
Copy link
Member

it should be fixed in #7047, feel free to reopen it if you have any other issues.

@neo-clon
Copy link

I have the same error, how can fix?

image

@edwin0cheng
Copy link
Member

@neo-clon Do you have more information about the crashed ? What is the actual error ? Are you using this week release ?

@neo-clon
Copy link

Yes I have the latest version.

The macros are from serde

This is my enviroment:

  • Arch linux X64
  • NVIM: 0.4.4
  • rustc 1.48.0
  • coc.nvim version: 0.0.80-cf0e8400a4
  • coc-rust-analyzer 0.25.0
  • rust-analyzer 1d53075 (stable channel)
  • CocConfig:
    rust-analyzer.procMacro.enable: true
    rust-analyzer.cargo.loadOutDirsFromCheck: true

In vscode i have the same error and the output Rust Analyzer Language Server show this message
[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(None)

And if add RA_LOG=info as env var i see this
image

@edwin0cheng
Copy link
Member

I can't reproduce in current master (a9814fa) 👍

Screenshot from 2020-12-31 14-14-23

Maybe you could wait and see if it is fixed in coming nightly. If it is not still fixed, a minimal reprod will help a lot :)

@neo-clon
Copy link

I can reproduce in a new project
image

Only copy my Cargo.toml from my main project maybe is any dependency the problem

[dependencies]
actix-web = "3.3.2"
actix-web-httpauth = "0.5.0"
serde = { version = "1.0.118", features = ["derive"] }
serde_json = "1.0.61"
dotenv = "0.15.0"
log = "0.4.11"
env_logger = "0.8.2"
sqlx = { version = "0.4.2", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "chrono", "decimal", "json", "migrate", "uuid" ] }
chrono = { version = "0.4.19", features = ["serde"] }
jsonwebtoken = "7.2.0"
futures-util = "0.3.8"
snafu = "0.6.10"
reqwest = { version = "0.10.10", features = ["json"] }
redis = "0.19.0"
futures = "0.3.8"
regex = "1.4.2"
actix-cors = "0.5.3"
rust_decimal = { version = "1.9.0", default-features = false, features = ["std", "serde-float"] }
listenfd = "0.3.3"
uuid = { version = "0.8.1", default-features = false, features = ["serde"] }
actix-rt = "1.1.1"
rand = "0.8.0"
actix-files = "0.5.0"
async-trait = "0.1.42"

@neo-clon
Copy link

neo-clon commented Dec 31, 2020

I have found which dependency causes the crash

sqlx = { version = "0.4.2", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "chrono", "decimal", "json", "migrate", "uuid" ] }

@edwin0cheng
Copy link
Member

sqlx = { version = "0.4.2", default-features = false, features = [ "runtime-actix-rustls", "macros", "postgres", "chrono", "decimal", "json", "migrate", "uuid" ] }

Oh, our old friend sqlx ! It seem to not related to this issue. :)

Would you mind to open an new issue for that ?

@neo-clon
Copy link

Yes i can open the issue, but in this repo or in slqx? hahaha in sqlx it will stay for a long time without movement XD

@edwin0cheng
Copy link
Member

edwin0cheng commented Dec 31, 2020

In this repo.

Actually it is our bug to make sure every usage is not crashing the server.

@neo-clon
Copy link

Excellent, thank you very much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

6 participants