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:
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
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!
Embedded Wizard Website | Privacy Policy | Imprint