Open niondir opened 3 years ago
Two questions:
this
pointer in rx_timeout_interrupt_handler
valid ?this
calling process_reception_timeout
always invalid or does it become invalid after some operation ? @pan-
In rx_timeout_interrupt_handler
the pointer was correct, I was following the calls through the call stack down to the enqueue. Somewhere on the way down the debugger states that this
was optimized out. In the end a wrong address was written to the queue.
I disabled all other threads, I'm pretty sure it's not overwritten "in between" due to some concurrent code or stack overflow.
Description of defect
Compiler optimization "-Os" in "--profile release" leads to wrong this point in
EvenQueue
event call.Using the LoRaWAN stack in function
void LoRaWANStack::process_reception_timeout(bool is_timeout)
the this pointer is broken.Further analysis shows that this is only the case when compiling with the release profile. The error happens already in
int equeue_post(equeue_t *q, void (*cb)(void *), void *p)
where the event data (holding the this pointer) is already broken. Called by:Target(s) affected by this defect ?
Custom Target:
Toolchain(s) (name and version) displaying this defect ?
What version of Mbed-os are you using (tag or sha) ?
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
$ mbed --version 1.10.5
Building with CMake after
mbed export -i cmake_gcc_arm --profile release
How is this defect reproduced ?
See description above. I can't give the full sourcecode to reproduce right now. But I'm happy to test fixes.
I also need to update arm mbed and test again - but that needs further changes in my project and will follow later.