[CTD] Crash while compiling WASM module

Hello, I am trying to compile our MD-11 for MSFS and doing so causes the
simulator to crash before even completing compilation. This happens in Debug
or Release configuration with Fast WASM compilation enabled. Similar to
another report here in the forums, trying without Fast WASM resulted in a
stalled compilation that I aborted after over 20 minutes of waiting. I found
another topic from 2019 mentioning the use of the library, which I modified a
class to remove with no change. Any help would be greatly appreciated. For
reference, this was the other post I read with the exact same symptoms: [[CTD]
Crash when compiling WASM module - MSFS DevSupport
(flightsimulator.com)](https://devsupport.flightsimulator.com/questions/9128/ctd-
ctd-when-compiling-wasm.html) The WASM file in question: <https://invernyx-
Sign in to your account
PmBxGOKmoxeCmgU8w?e=pUNNvn>

Further to this, I ensured that preprocessor definitions and compiler settings
were preserved from the samples. This made no difference.

Hi, Sorry for the delay, i forgot to update this post. I have found the
problem. There was a very rare case in your wasm file, in which some functions
have a weird “address” behaviour. They were too close in memory and that
leaded to an error on our side. That has been fixed on our side and your wasm
file compiles well on my side. Unfortunately, this fix happens too late and
modifies “dangerous” things about wasm compilation to be pushed to SU10b. On
your side, you can try some things to try to make it work. The major problem
comes from “search_substring” function (the wstring one).

  • Remove compilation option which might lead to this function memory problem
  • Locate this function in your code and see you de “unusual” thing
  • Try to add some entropy in your code to break this memory problem

I wish I had better advices or a real solution to solve your problem. Best
Regards Maxime / Asobo

Hello, Thank you for the response! It’s comforting to know it wasn’t something
we were doing wrong. I understand it is a significant change so there may be a
delay; when, realistically, do you think we could expect to see this update
(at least in beta) for us to test? In the mean time, I will see if I can
figure out what’s happening with the addresses. Edit: I reviewed our code and
no such function “search_substring” exists. Can you possibly point me to some
more details about the issue so I can try to work around it?

Out of curiosity, it seems like the hidden (to third party devs)
implementation details is not as mature as I thought. Are this “weird” hard to
catch bugs the result of the way Asobo have implemented inNative or a lesser
supported library (vs something like Wasmer)?

Hi @turbofandude, As you might know, SU10 has been delayed. Because we have
more time to test it, we have integrated the fix that I told you last week.
Can you please test the last SU10 build (1.27.16.0) with your package and let
me know about the result. As I said in my previous post, this fix might be
dangerous. So please, keep in mind that if we detect issues, regressions… we
may undo this change. Best Regards Maxime / Asobo

Excellent! I was able to compile successfully with SU10 beta. Also, the VS2022
toolset addition to the SDK is very much appreciated as well! I am still
experiencing an issue that almost seems like memory allocations are happening
asynchronously but I haven’t been able to isolate it yet.