Skip to content

[SourceKit] Run interface generation request on a deep stack #75576

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

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 31, 2024

Building the generated interface for WinSDK can overflow the stack. Treat it as a semantic request to run it on a large stack.

Fixes swiftlang/sourcekit-lsp#1115
rdar://123944504

Building the generated interface for WinSDK can overflow the stack.
Treat it as a semantic request to run it on a large stack.

Fixes swiftlang/sourcekit-lsp#1115
rdar://123944504
@ahoppen
Copy link
Member Author

ahoppen commented Jul 31, 2024

@swift-ci Please smoke test

@ahoppen
Copy link
Member Author

ahoppen commented Jul 31, 2024

@swift-ci Please smoke test Linux

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Nice find!

@@ -938,7 +938,7 @@ handleRequestEditorOpenInterface(const RequestDict &Req,
std::optional<StringRef> InterestedUSR = Req.getString(KeyInterestedUSR);
return Rec(editorOpenInterface(*Name, *ModuleName, GroupName, Args,
SynthesizedExtension, InterestedUSR));
}
});
}

static void handleRequestEditorOpenHeaderInterface(
Copy link
Contributor

Choose a reason for hiding this comment

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

While here, should we also do the same for header interfaces?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let’s only change this request for now. We don’t use the open header interface on Windows (ie. from SourceKit-LSP) and it hasn’t been an issue on macOS. At some point we should probably re-think what queues all the callbacks etc. run on and whether they need a deep stack…

@ahoppen ahoppen merged commit 1f4a722 into swiftlang:main Jul 31, 2024
3 checks passed
@ahoppen ahoppen deleted the interfacegen-semantic branch July 31, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Windows] Crash on Go to Definition
2 participants