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

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!


GenericNerd avatar image
GenericNerd asked GenericNerd commented

Cloning a geometry causes aircraft to go into Dirty state

Hello there,

I'm currently trying to clone a geometry on the DU1 WASM Gauge. I've found that cloning this specific geometry is causing the aircraft to go into a "DIRTY" status after the first rendered frame.

I've had no issues rendering a geometry, ellipsis or any other item in GDI+ up to this point. I did notice that in the WasmGdiPlus.sln source, memcpy was used. We were under the impression that this was not permitted in the simulator. Could this be the cause of the DIRTY state?

I've provided the WASM itself and the PANEL.CFG file in a folder: MSFS Dirty State WASM

The error itself was the following:

WASM: Exception c0000001d in gauge DU1 in module vfs://tfdi-design-md-11/SimObjects/Airplanes/TFDi_Design_MD-11/panel/md11host.wasm

Any advice or suggestions would be greatly appreciated.


Fabio Almeida

10 |10000

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

FlyingRaccoon avatar image FlyingRaccoon ♦♦ commented ·
Hello @GenericNerd

There is no restriction on memcpy usage. All functions that are accessible in your WASM environment can be used.
Can you please show here the piece of code that produces this exception?


0 Likes 0 ·
GenericNerd avatar image GenericNerd FlyingRaccoon ♦♦ commented ·

@FlyingRaccoon Here's the line of code that causes the exception, this exception only happens on the second frame.

GraphicsPath* roll_triangle_bottom = pfd->ah_geo_roll_triangle_bottom->Clone();

The reason for the clone is to transform a geometry and keep the original non-transformed version of the geometry.

0 Likes 0 ·

1 Answer

FlyingRaccoon avatar image
FlyingRaccoon answered GenericNerd commented

Hello @GenericNerd

We have identified the problem.
The issue comes from some erroneous memcpy and memmove defines that are located in %MSFS SDK%\WASM\projects\gdiplus\src\FlatNVG\graphics-path.cpp at lines 38/39:


The memcpy define was used only in the case of a GraphicsPath cloning and causes memory corruption.
This will be fixed in the next version of the SDK but you can remove it in your SDK files to fix your problem.

Thank you for reporting the issue :)


1675937779139.png (26.0 KiB)
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.

GenericNerd avatar image GenericNerd commented ·
@FlyingRaccoon I'm really glad to hear it! Can't wait for this bug to be fixed. I'll make sure to report any bugs if I find any more ;)
2 Likes 2 ·

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.