plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

We prepared 3 new YouTube tutorials about Audio! They are available here.
You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!


question

uraymeiviar avatar image
uraymeiviar asked uraymeiviar commented

always CTD when running wasm compiled in Debug version

Whenever I put Debug compiled version of my .wasm the sim always crash (CTD) on loading the flight (same with fast wasm compilation on or off)

but if I compile my .wasm in Release mode its just running fine (but obviously I can't debug)

  • I use Visual Studio 2019 on Windows 10 latest update
  • project created using Visual Studio MSFS wasm project wizard.
  • I don't attach visual studio debugger to FlightSimulator.exe
  • Project build inside msfs project editor is fine
  • msfs version 1.21.13.0 same with previous versions
  • Last message in console window (related to my project) is "WASM: Compiling module my.wasm", then just crash after a while without any log after
  • Tried re-installing the whole msfs to no effect
  • Community Folder is empty and no addon installed other than official asobo stuff

anyone has this issue, or is there something i need to check?, I can submit msfs crash dump but its 8GB


wasm
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Alex avatar image
Alex answered uraymeiviar commented

When I tried to do it with the Rust language about 2-3 month ago I had the same problem but I thought that the problem was because I used Rust. Now it seems the Rust was not the reason. Will follow your question.

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

also it seems it happen only if I did heavy use of c++ standard libary, if its just plain C, it has no problem, just like wasm demo from sdk can be run in debug mode too
0 Likes 0 ·
FlyingRaccoon avatar image
FlyingRaccoon answered uraymeiviar commented

Hello @uraymeiviar

This crash comes from one of the libc function being misinterpreted by WebAssembly.
This will be fixed in upcoming updates (No precise ETA but not before SU9).

In the meantime, the workaround is to remove any include of <functional> and any usage of the LoggerFile class.

Regards,
Sylvain

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

wow glad to know, will check... thank you very much
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.