Related Component
compiler
Problem
hover_data in sway-lsp contains a possible double read deadlock on state.engines
hover_data is called in handle_hover with &state.engines.read()
|
Ok(capabilities::hover::hover_data( |
|
state, |
|
sync, |
|
&state.engines.read(), |
|
&uri, |
|
position, |
|
)) |
Inside hover_data, if there is no token identity, hover_format is called with &state.engines.read()
|
None => hover_format( |
|
&state.engines.read(), |
|
token, |
Steps
While running hover_data with contents of type without an ident field (literals, etc...), a concurrent .write() on the engines lock will deadlock.
Possible Solution(s)
Delete the .read() inside the hover_format function call
Notes
Found through some static analysis, similar bug to #7145
Installed components
Related Component
compiler
Problem
hover_datain sway-lsp contains a possible double read deadlock onstate.engineshover_data is called in handle_hover with &state.engines.read()
sway/sway-lsp/src/handlers/request.rs
Lines 141 to 147 in ac418cc
Inside hover_data, if there is no token identity, hover_format is called with &state.engines.read()
sway/sway-lsp/src/capabilities/hover/mod.rs
Lines 73 to 75 in ac418cc
Steps
While running
hover_datawith contents of type without an ident field (literals, etc...), a concurrent.write()on the engines lock will deadlock.Possible Solution(s)
Delete the
.read()inside thehover_formatfunction callNotes
Found through some static analysis, similar bug to #7145
Installed components
N/A