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

DAP get variables request can fail if no breakpoint is hit before it being requested #5625

Closed
filipdutescu opened this issue Jan 21, 2023 · 0 comments · Fixed by #5628
Closed
Labels
A-debug-adapter Area: Debug adapter client C-bug Category: This is a bug

Comments

@filipdutescu
Copy link
Contributor

filipdutescu commented Jan 21, 2023

Summary

Due to unchecked access to a HashMap, the dap_variables method (found in helix-term/src/commands/dap.rs) can generate a panic not handled, crashing the program.

Reproduction Steps

I tried this:

  1. Open helix and attach to a running process (ie Helix opened with a file)
  2. Request variables through <space>gv, before a breakpoint is hit (I tried it in the format method of Document)

I expected this to happen:

Either show nothing or a message mentioning that no breakpoint has been hit.

Instead, this happened:

Panic and crash due to unchecked bounds.

Helix log

N/A here

Platform

Linux

Terminal Emulator

alacritty 0.11.0 (8dbaa0bb)

Helix Version

helix 22.12

@filipdutescu filipdutescu added the C-bug Category: This is a bug label Jan 21, 2023
@the-mikedavis the-mikedavis added the A-debug-adapter Area: Debug adapter client label Jan 21, 2023
filipdutescu added a commit to filipdutescu/helix that referenced this issue Jan 21, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes helix-editor#5625
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit to filipdutescu/helix that referenced this issue Jan 21, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: helix-editor#5625
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit to filipdutescu/helix that referenced this issue Jan 22, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: helix-editor#5625
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit to filipdutescu/helix that referenced this issue Jan 23, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: helix-editor#5625
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit to filipdutescu/helix that referenced this issue Feb 4, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: helix-editor#5625
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
archseer pushed a commit that referenced this issue Feb 20, 2023
Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: #5625

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
wes-adams pushed a commit to wes-adams/helix that referenced this issue Jul 4, 2023
…itor#5628)

Check if the stack frames contain the thread id and the frame before
trying to get the frame id. If case any of the two fails to be
found, provide the user with messages to inform them of the issue and
gracefully return.

Closes: helix-editor#5625

Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debug-adapter Area: Debug adapter client C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants