rust-nostr/nostr

NWC: Windows Release Build Panic

Closed this issue ยท 7 comments

Describe the bug
Using the NWC crate, all functionality works great in development and all releases work well except for Windows release builds. As soon as a network request is made, the app will panic with "thread main has overflowed it's stack". The issue also bleed over to other network requests from unrelated crates as well.

To Reproduce

  • Init NWC and make any calls over the network
  • Compile a release build for Windows
  • Run and see error

Expected behavior
Expect it to work on Windows the same as it does on other platforms and dev builds as well as not interfering with other network calls.

Build environment

  • Library: NWC
  • Language: Rust
  • Language version: 1.80.1
  • Tag/commit: v0.34.1
  • OS+version: Windows 11

Additional context
The other crate that appears to be interfered with is esplora-client. Calls to connect to an Esplora instance fail with the same error when the NWC crate is installed.

I will try some earlier versions to see if this is a recently introduced issue.

I have tried 0.33.0 and the same issue exists. I then tried 0.32.0 but there were some larger changes between those versions, so would take a while to refactor my app to work with that version, so not sure if the issue is in that version as well.

Maybe I found the issue: seems that large futures may cause stack overflow.

Can you confirm that this patch fix the issue? Try to add it to your Cargo.toml

[patch.crates-io]
async-wsocket = { git = "https://github.com/yukibtc/async-wsocket", rev = "bd5d2c39e29c4885d5c04df177d8493e45e3afd4" }

Yep that fixes it ๐Ÿฅณ

Thanks for confirmation! I'm going to release the patch

Thanks again for being so responsive! This unblocks a release I have been sitting on for a while, so really appreciate you fixing this and on a weekend no less ๐Ÿ™

No problem! I've published the patch for async-wsocket, make sure to bump it in your Cargo.lock to v0.7.1:

cargo update -p async-wsocket