114 views
in Platform Packages by

Hello Embedded Wizard Team, 

My team has encountered what we believe to be a bug regarding the usage of EwInvokeCopy. This is a reproducible but intermittent issue. In the application, there are 2 threads: a UI thread for Embedded Wizard, and then a data thread to pass received data to update the UI. The data thread always uses EwInvokeCopy to pass the data to the UI thread for processing. However, what we have seen is that when the function "aProc" in the documentation (https://doc.embedded-wizard.de/ansic-rte-ewinvokecopy) is called in the context of the UI thread, the data passed to "aProc" is nullptr. This causes the application to crash since we are dereferencing nullptr. We are using the Embedded Wizard 14 Professional Platform Package and we were able to use EwPrint to confirm that the data passed to EwInvokeCopy is valid and it somehow gets corrupted during the ProcessNextInvocation call. I have created a simple application that demonstrates this behavior - again, it is an intermittent issue, so we normally have to let the application run for a certain amount of time.

Additional details:

  • Linux kernel version 6.6.23 (scarthgap Yocto project codename)
  • Target hardware is a Toradex Verdin IMX8M Plus SoM. 
  • Toolchain - Clang 18.1.6
I also have some stack traces and debug snapshots that could be useful. 
 
Sincerely, 
Eric

1 Answer

0 votes
by

Hello Eric,

could you please verify whether EwInvokeCopy() is always invoked with aSize parameter > 0? Passing 0 in aSize will have the effect of NULL value being passed later in the aProc callback function. It is as if you had invoked EwInvoke( aProc, NULL ).

If aSize is guaranteed to be always > 0 and the issue occurs, please provide us an example to reproduce the behavior.

Best regards

Paul Banach

by
Hi Paul,

We are using the sizeof operator to calculate the size when calling EwInvokeCopy(), so this should always be > 0. I will reach out to you via the Professional Support Email to send an example of the issue.

Sincerely,

Eric

Embedded Wizard Website | Privacy Policy | Imprint

...