Skip to content

Crash when trying to use memory usage command #11119

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
bjorn3 opened this issue Dec 26, 2021 · 5 comments
Closed

Crash when trying to use memory usage command #11119

bjorn3 opened this issue Dec 26, 2021 · 5 comments
Labels
C-bug Category: bug

Comments

@bjorn3
Copy link
Member

bjorn3 commented Dec 26, 2021

This happened right after the memory usage pane popped up. The project in question is rust with the workspace Cargo.toml changed to only include src/bootstrap.

Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/codeLens CodeLensParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileSourceRootQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <base_db::FileLoaderDelegate<&T> as base_db::FileLoader>::relevant_crates
   5: <ide_db::RootDatabase as base_db::FileLoader>::relevant_crates
   6: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
   7: ide::parent_module::crate_for
   8: std::panicking::try
   9: rust_analyzer::cargo_target_spec::CargoTargetSpec::for_file
  10: rust_analyzer::handlers::handle_code_lens
  11: std::panicking::try
  12: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 15:12:32] Request textDocument/codeLens failed.
  Message: server panicked: no value set for FileSourceRootQuery(FileId(0))
  Code: -32603 
Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/hover HoverParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    position: Position(
        Position {
            line: 138,
            character: 12,
        },
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileTextQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <ide_db::RootDatabase as base_db::FileLoader>::file_text
   5: salsa::runtime::Runtime::execute_query_implementation
   6: salsa::derived::slot::Slot<Q,MP>::read_upgrade
   7: salsa::derived::slot::Slot<Q,MP>::read
   8: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   9: <DB as ide_db::LineIndexDatabase>::line_index::__shim
  10: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
  11: rust_analyzer::from_proto::file_range
  12: rust_analyzer::handlers::handle_hover
  13: std::panicking::try
  14: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 15:12:33] Request textDocument/hover failed.
  Message: server panicked: no value set for FileTextQuery(FileId(0))
  Code: -32603 
Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/hover HoverParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    position: Position(
        Position {
            line: 155,
            character: 21,
        },
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileTextQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <ide_db::RootDatabase as base_db::FileLoader>::file_text
   5: salsa::runtime::Runtime::execute_query_implementation
   6: salsa::derived::slot::Slot<Q,MP>::read_upgrade
   7: salsa::derived::slot::Slot<Q,MP>::read
   8: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   9: <DB as ide_db::LineIndexDatabase>::line_index::__shim
  10: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
  11: rust_analyzer::from_proto::file_range
  12: rust_analyzer::handlers::handle_hover
  13: std::panicking::try
  14: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 15:12:35] Request textDocument/hover failed.
  Message: server panicked: no value set for FileTextQuery(FileId(0))
  Code: -32603 
Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 157,
            character: 9,
        },
        end: Position {
            line: 157,
            character: 9,
        },
    },
    context: CodeActionContext {
        diagnostics: [],
        only: None,
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileTextQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <ide_db::RootDatabase as base_db::FileLoader>::file_text
   5: salsa::runtime::Runtime::execute_query_implementation
   6: salsa::derived::slot::Slot<Q,MP>::read_upgrade
   7: salsa::derived::slot::Slot<Q,MP>::read
   8: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   9: <DB as ide_db::LineIndexDatabase>::line_index::__shim
  10: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
  11: rust_analyzer::handlers::handle_code_action
  12: std::panicking::try
  13: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/codeLens CodeLensParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileSourceRootQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <base_db::FileLoaderDelegate<&T> as base_db::FileLoader>::relevant_crates
   5: <ide_db::RootDatabase as base_db::FileLoader>::relevant_crates
   6: hir::semantics::source_to_def::SourceToDefCtx::file_to_def
   7: ide::parent_module::crate_for
   8: std::panicking::try
   9: rust_analyzer::cargo_target_spec::CargoTargetSpec::for_file
  10: rust_analyzer::handlers::handle_code_lens
  11: std::panicking::try
  12: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 15:12:36] Request textDocument/codeLens failed.
  Message: server panicked: no value set for FileSourceRootQuery(FileId(0))
  Code: -32603 
Panic context:
> 
version: 0add6e95e 2021-12-20 stable
request: textDocument/hover HoverParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/bjorn/Projects/rust/src/bootstrap/format.rs",
            query: None,
            fragment: None,
        },
    },
    position: Position(
        Position {
            line: 138,
            character: 39,
        },
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread '<unnamed>' panicked at 'no value set for FileTextQuery(FileId(0))', /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/salsa-0.17.0-pre.2/src/input.rs:106:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::{{closure}}
   3: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   4: <ide_db::RootDatabase as base_db::FileLoader>::file_text
   5: salsa::runtime::Runtime::execute_query_implementation
   6: salsa::derived::slot::Slot<Q,MP>::read_upgrade
   7: salsa::derived::slot::Slot<Q,MP>::read
   8: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
   9: <DB as ide_db::LineIndexDatabase>::line_index::__shim
  10: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
  11: rust_analyzer::from_proto::file_range
  12: rust_analyzer::handlers::handle_hover
  13: std::panicking::try
  14: <F as threadpool::FnBox>::call_box
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 15:12:40] Request textDocument/hover failed.
  Message: server panicked: no value set for FileTextQuery(FileId(0))
  Code: -32603

rust-analyzer version: 0add6e9 2021-12-20 stable

rustc version: rustc 1.59.0-nightly (91a0600a5 2021-12-18)

@bjorn3 bjorn3 added the C-bug Category: bug label Dec 26, 2021
@lnicola
Copy link
Member

lnicola commented Dec 26, 2021

I can't look for it now, but I filed a similar issue a while ago, it's closed now as won't fix.

@Veykril
Copy link
Member

Veykril commented Dec 26, 2021

This one #10444?

@lnicola
Copy link
Member

lnicola commented Dec 26, 2021

Yeah, and #9168 linked there.

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 26, 2021

Would it be possible to immediately repopulate all inputs after running the memory usage command? Or maybe use manual counting rather than clearing for getting the memory usage of the file content query?

@Veykril
Copy link
Member

Veykril commented Feb 8, 2023

I don't think salsa allows us to get that info, I'm inclined to close this as a wont-fix as its debugging command

@Veykril Veykril closed this as completed Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants