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

Fix crash during code editor folding and LSP #92301

Merged

Conversation

robert-wallis
Copy link
Contributor

@robert-wallis robert-wallis commented May 24, 2024

closes #76447

Adding a bounds check on delimiter_cache which in my repro has size 1 but p_line is also 1

Repro Steps

  1. open Godot
  2. open script editor in Godot (important)
  3. open VSCode, use and connect godot-tools to LSP
  4. edit different file then step 3, add a function, delete function, save
  5. crash

Tested On:

  • Win 10 22H2; VSCode; godot-tools 2.0.0; 4.2.2-stable reproduce crash: ✅ (crashes with above steps)
  • Win 10 22H2; VSCode; godot-tools 2.0.0; this branch: repro steps pass ✅--test success ✅
  • Win 10 22H2; VSCode; godot-tools 2.0.0; (cherry picked on) Godot 4.2.2 15073af: repro steps pass ✅--test success ✅
  • MacOS 14.5 Intel: VSCode; godot-tools 2.0.0; 4.2.2-stable reproduce crash: ❌ (doesn't crash)
  • MacOS 14.5 Intel; VSCode; godot-tools 2.0.0; this branch: repro steps pass ✅ --test success ✅
  • MacOS 14.5 Intel; VSCode; godot-tools 2.0.0; (cherry picked on) Godot 4.2.2 15073af: repro steps pass ✅ --test success ✅

@robert-wallis robert-wallis requested a review from a team as a code owner May 24, 2024 03:28
@YeldhamDev YeldhamDev added this to the 4.3 milestone May 24, 2024
@akien-mga akien-mga added cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels May 24, 2024
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good as a stop-gap measure for a crash that seems to affect a lot of users.

But as pointed out in the bug report the bug is likely deeper, and would be worth looking into. CC @Paulb23 @kitbdev

I'm not even sure why CodeEdit is involved at all for users using external editors with LSP.

@akien-mga akien-mga merged commit a10897d into godotengine:master May 28, 2024
16 checks passed
@akien-mga
Copy link
Member

akien-mga commented May 28, 2024

Thanks! And congrats for your first merged Godot contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release crash topic:gui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash Index p_index = 1 is out of bounds (size() = 0)
3 participants