fix(macros): invoke handler stack overflow - #13217
Merged
lucasfernog merged 5 commits intoApr 14, 2025
Merged
Conversation
Contributor
Package Changes Through e05c624There are 8 changes which include @tauri-apps/api with minor, tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-utils with minor, tauri-bundler with minor, tauri-runtime with minor, tauri-runtime-wry with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Legend-Master
marked this pull request as ready for review
April 13, 2025 09:32
lucasfernog
reviewed
Apr 14, 2025
| // see https://github.com/tauri-apps/tauri/issues/12488 | ||
| { | ||
| #[cfg_attr(not(debug_assertions), inline(always))] | ||
| move || { |
Member
There was a problem hiding this comment.
ohh so nice that Rust optimizes this for us on release ❤️ awesome idea
lucasfernog
approved these changes
Apr 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #12488
This is a very similar bug as #9882, the debug build of rust seems unable to optimize the function stack size, and with a small stack size limit on Windows, it overflows, and in release build, the optimization kicks in and there're no problems
So this fix turns each macro into a closure in debug build so rust wouldn't allocate the memory all at once and crash