Execute_caulcuator_code() via wasm causes CTD with SU4 beta

Version: 1.6.5.0

Frequency: Consistently

Severity: Blocker

Context: MobiFlight’s WASM module, mounted from community folder

Similar MSFS 2020 issue: n/a

Bug description:

SU4 Beta will CTD when any input is sent from MobiFlight’s WASM Module to the sim. This did not occur with SU3 (or any other version of MSFS in the past, going back as far as the original 2020 release).

This was reported by one of our users and independently confirmed by me. It’s 100% reproducible.

Repro steps:

  1. Install MobiFlight
  2. Run it so the WASM module installs
  3. Run MSFS2024 and spawn a plane somewhere
  4. Configure some sort of input in MobiFlight (even a joystick button will work) to trigger something in the sim
  5. Press that input

Result: Sim locks up then crashes to desktop

Expected result: Sim responds to the input from MobiFlight like it always has

The WASM module is using execute_calculator_code().

Crash details from event viewer

Faulting application name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Faulting module name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000002d6b332
Faulting process id: 0xB450
Faulting application start time: 0x1DC2339065649BF
Faulting application path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Report Id: 91746e26-6ad7-4ca6-b7a9-7c9354b94edd
Faulting package full name: Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

2 Likes

I also get the same result if I use the Execute Calculator Function in fsuipc. the sim instantly crashes to desktop.

1 Like

Oh boy.

www.youtube. com/watch?v=n8ZbpxV382U

Hi,

I tried to use Mobiflight & FsUIPC on a custom build and on the retail one, but I couldn’t make it crash.

I triggered simple KEvent using both those softwares and it worked well. I assume that a more complex RPN causes the crash.

Could you provide me with a RPN string that crashes (or more info about your repro step)?

Best Regards

Maxime / Asobo

I am using execute_calculator_code(). on 3 products in MSFS 2020, these are running on MSFS 2024 SU4 without crash.

I also changed 2 WASM Modules 2024 native to use execute_calculator_code(). to extract E:VARS while a fix is implemented for the V1 WASM API Vars for environment variables and is not crashing either.

I think the CTD might be related to what you are executing on the execute_calculator_code(). so perhaps posting the instruction you sending will help Asobo devs to replicate.

Best,
Raul

In my case I was sending 1 (>K:PARKING_BRAKE_SET), although other events have caused it as well. None of the RPN was complicated, they were all basic “set a value” calls.

We had one user tell us they didn’t see a crash either, but they came back a few minutes later and said the sim had completely locked up. Here are a few others from a user:

(>B:AUTOPILOT_AP_MASTER_TOGGLE) ← freeze + crash

@ 32.0293 * 16383 - -16383 max 16383 min (>K:MIXTURE_SET) ← works

1 Like

I spent some time trying to figure out a clean repo this afternoon without much success. All tests were done with the Cessna 172 Skyhawk spawned on the KPDX runway.

Using WASimCommander to send the single parking brake event worked fine. Even if I clicked the “calculate” button repeatedly the sim was fine.

I tried MobiFlight with a simple profile that only had a single input event for the parking brake and it too was fine. Pressing the mapped joystick button was fine, even if I clicked it repeatedly.

I loaded a more complicated profile and the sim locked up immediately and crashed when MobiFlight sent a bunch of initial states to the sim.

That made me think it has something to do with sending a lot of events in succession, so I tried a profile where I have an encoder mapped to the barometric pressure and I spun the encoder a lot. But… no freeze or crash.

Here’s the crash entry for the one time I made it happen this afternoon:

Faulting application name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Faulting module name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000002d6b332
Faulting process id: 0xA904
Faulting application start time: 0x1DC243FFCED104C
Faulting application path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Report Id: b98d1134-b03c-4642-80b8-0186ea83a5eb
Faulting package full name: Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

One of our users did some more testing and reported this:

I did some more testing and in the c172 sending the (>B:MASTER_BATTERY_OFF) managed to get a crash in Mobiflight, FSUIPC, AxisandOhs, Spadnext & wasimcommander

On my end I don’t get a crash, but reading from and writing to BVars via “execute_calculator_code” only works once, then never again. This used to work fine up until and including SU3.

Best regards
Oliver

1 Like

I see there are a few other WASM issues reported by others that aren’t a crash but do indicate broader issues with WASM in SU4:

Are these all perhaps related? Can we expect a fix for the crash in an upcoming beta?

Thanks!

Those were nothing relate to execute calculator code, in fact I use execute calculator code on each update frame for all my products and I am not experiencing any CTDs.

R.

While you may not be experiencing a CTD, many others are as evidenced from comments here, reproduced in five different products.

We’ve also had several users report they aren’t seeing a crash, only to come back later and update to say they have also had the sim freeze and eventually crash.

I understand, but is not related to the links you posted.. and as I said, I think Asobo needs examples of the codes you guys executing on calculator code, the function itself is not the problem or all my planes would be having CTD parties..

Must be the parameters used for the function, data or something used with the function, my use case is pretty simple.. nothing fancy..

R.

There are already three different examples of RPN that caused the issue shared in this thread.

I’ve spent quite a bit of time this morning trying to reproduce the issue cleanly. I had multiple freezes when opening my standard C172 configuration in MobiFlight, which isn’t helpful since it has quite a few events in it. It didn’t freeze consistently either, which also isn’t helpful.

Frustrated, I gave up and focused instead on splitting off @lorbysi’s issue about Bvars only working once. I managed to lock the sim up three times while reproducing that issue. :sweat_smile:

I sent 0 (>B:MASTER_BATTERY_OFF)via WASimCommander in a Cessna 172 spawned on the runway at KPDX using a freshly-launched sim. The sim froze instantly.

I also managed to make it happen twice with MobiFlight using 1 (>B:MASTER_BATTERY_OFF), again in a freshly-launched sim.

Faulting application name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Faulting module name: FlightSimulator2024.exe, version: 1.6.5.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000002d6b332
Faulting process id: 0x1273C
Faulting application start time: 0x1DC27D28B2331D3
Faulting application path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe\FlightSimulator2024.exe
Report Id: 27d91553-4577-4a71-876b-d7c80b386b22
Faulting package full name: Microsoft.Limitless_1.6.5.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

Hi everyone,

These issues have been fixed on our end but you’ll need an SU4 Beta update to get those fixes.

No ETA for now but hopefully it won’t take too long.

Best regards,

Eric / Asobo

5 Likes

Brilliant, thanks for the confirmation Eric! Am happy to wait and confirm the fix whenever it makes it into a beta. Simply knowing it’s been addressed is good news.

2 Likes

The fix for this (and the other WASM issues) is listed in the release notes for 1.6.7.0. I spent a bunch of time trying to reproduce the issue with this build and couldn’t.

Thanks for the fix guys!

1 Like