Skip to content

fix(macros): invoke handler stack overflow - #13217

Merged
lucasfernog merged 5 commits into
tauri-apps:devfrom
Legend-Master:fix-invoke-handler-stack-overflow
Apr 14, 2025
Merged

fix(macros): invoke handler stack overflow#13217
lucasfernog merged 5 commits into
tauri-apps:devfrom
Legend-Master:fix-invoke-handler-stack-overflow

Conversation

@Legend-Master

@Legend-Master Legend-Master commented Apr 12, 2025

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Apr 12, 2025

Copy link
Copy Markdown
Contributor

Package Changes Through e05c624

There 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 Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.4.1 2.5.0
tauri-utils 2.3.1 2.4.0
tauri-bundler 2.3.1 2.4.0
tauri-runtime 2.5.1 2.6.0
tauri-runtime-wry 2.5.1 2.6.0
tauri-codegen 2.1.1 2.1.2
tauri-macros 2.1.1 2.1.2
tauri-plugin 2.1.1 2.1.2
tauri-build 2.1.1 2.1.2
tauri 2.4.1 2.5.0
@tauri-apps/cli 2.4.1 2.5.0
tauri-cli 2.4.1 2.5.0

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
Legend-Master marked this pull request as ready for review April 13, 2025 09:32
@Legend-Master
Legend-Master requested a review from a team as a code owner April 13, 2025 09:32
// see https://github.com/tauri-apps/tauri/issues/12488
{
#[cfg_attr(not(debug_assertions), inline(always))]
move || {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ohh so nice that Rust optimizes this for us on release ❤️ awesome idea

@lucasfernog
lucasfernog merged commit 690146e into tauri-apps:dev Apr 14, 2025
@Legend-Master
Legend-Master deleted the fix-invoke-handler-stack-overflow branch April 15, 2025 01:25
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.

[bug] [windows] invoking commands causes crash.

2 participants