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 - Archive
Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!
Your resources:
The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.
For dedicated assistance, explore our Embedded Wizard Product Support.
You can still browse the valuable discussions from our community history here.
Embedded Wizard Website | Privacy Policy | Imprint