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](https://invernyx-
Sign in to your account)
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. Thanks, Fabio Almeida

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? Regards, Sylvain

@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.

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 :slight_smile: Regards,
Sylvain

@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 :wink: