Gauge_calculator_code_precompile wasm error

Version: 1.0.72.0

Frequency: Consistently

Severity: High

Context: wasm gauge

Bug description:
Calling gauge_calculator_code_precompile function from a gauge compiled with 2020 SDK causes the gauge to crash with an error:
WASM: Error during KH Gauge Update - <gauge name> execution. Error code : 0xc0000005

It’s not a frequently used function and a workaround is to call execute_calculator_code directly without precompiling.

Repro steps:
This code in the gauge update callback will crash the gauge.

UINT32 len;
PCSTRINGZ str;
PCSTRINGZ source = "(P:SIMULATION RATE, number)";
BOOL status = gauge_calculator_code_precompile(&str, &len, source);

Attachments:

1 Like

Hello @some1

We were able to replicate this issue.
That’s caused by uninitialized variables not being handled correctly on our side.
Thank you for reporting it.

Regards,
Sylvain

1 Like

Hello @some1

This is fixed in build 1.0.77.0.

Regards,
Sylvain

Confirmed, the gauge does not crash any more in 1.0.77.0. Thanks!