mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
c6c84cccc9
19199: sys/suit: Ensure previous thread is stopped before reusing its stack r=benpicco a=chrysn ### Contribution description Closes: https://github.com/RIOT-OS/RIOT/issues/19195 If the thread has released the mutex but the thread has not terminated (which happens in the situation that would previously have overwritten a still active thread's state), then a warning is shown and the trigger is ignored. ### Testing procedure This should work before and after: * `make -C examples/suit_update BOARD=native all term` * `aiocoap-client coap://'[fe80::3c63:beff:fe85:ca96%tapbr0]'/suit/trigger -m POST --payload 'coap://[2001:db8::]/foo'` * In parallel, on the RIOT shell, run `suit fetch coap://[2001:db8::]/foo` * After the first download fails, the second one starts right away ("suit_worker: update failed, hdr invalid" / "suit_worker: started"). Run again with the worker thread on low priority: ```patch diff --git a/sys/suit/transport/worker.c b/sys/suit/transport/worker.c index a54022fb28..e26701a64c 100644 --- a/sys/suit/transport/worker.c +++ b/sys/suit/transport/worker.c `@@` -70 +70 `@@` -#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN - 1 +#define SUIT_COAP_WORKER_PRIO THREAD_PRIORITY_MAIN + 1 ``` Before, this runs the download once silently (no clue why it doesn't run it twice, but then again, I claim there's concurrent memory access from two thread, so who knows what happens). After, it runs a single download and shows an error message for the second one once the first is complete ("Ignoring SUIT trigger: worker is still busy."). ### Issues/PRs references This may be made incrementally easier by https://github.com/RIOT-OS/RIOT/pull/19197 -- that PR as it is now would spare us the zombification (because returning would do that), and having a `wait` function would allow us to turn the new error case into a success. 19205: boards/common: add common timer config for GD32VF103 boards r=benpicco a=benpicco 19207: examples/gnrc_border_router: static: use router from advertisements by default r=benpicco a=benpicco Co-authored-by: chrysn <chrysn@fsfe.org> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de> Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> |
||
---|---|---|
.. | ||
analog_util | ||
app_metadata | ||
arduino | ||
auto_init | ||
base64 | ||
benchmark | ||
bhp | ||
bitfield | ||
bloom | ||
bus | ||
can | ||
cb_mux | ||
checksum | ||
chunked_ringbuffer | ||
clif | ||
color | ||
congure | ||
cpp11-compat | ||
cpp_new_delete | ||
crypto | ||
cxx_ctor_guards | ||
debug_irq_disable | ||
div | ||
ecc | ||
eepreg | ||
embunit | ||
entropy_source | ||
event | ||
evtimer | ||
fido2 | ||
fmt | ||
frac | ||
fs | ||
fuzzing | ||
hashes | ||
include | ||
iolist | ||
isrpipe | ||
libc | ||
log_color | ||
log_printfnoformat | ||
luid | ||
malloc_thread_safe | ||
matstat | ||
memarray | ||
mineplex | ||
net | ||
newlib_syscalls_default | ||
od | ||
oneway-malloc | ||
phydat | ||
picolibc_syscalls_default | ||
pipe | ||
pm_layered | ||
posix | ||
preprocessor | ||
progress_bar | ||
ps | ||
puf_sram | ||
random | ||
riotboot | ||
rtc_utils | ||
rust_riotmodules | ||
rust_riotmodules_standalone | ||
saul_reg | ||
sched_round_robin | ||
schedstatistics | ||
sema | ||
sema_inv | ||
senml | ||
seq | ||
shell | ||
shell_lock | ||
ssp | ||
stdio_nimble | ||
stdio_null | ||
stdio_rtt | ||
stdio_semihosting | ||
stdio_uart | ||
stdio_udp | ||
suit | ||
test_utils | ||
timex | ||
tiny_strerror | ||
trace | ||
trickle | ||
tsrb | ||
universal_address | ||
uri_parser | ||
usb | ||
usb_board_reset | ||
ut_process | ||
uuid | ||
vfs | ||
vfs_util | ||
xtimer | ||
zptr | ||
ztimer | ||
ztimer64 | ||
doc.txt | ||
Kconfig | ||
Kconfig.newlib | ||
Kconfig.picolibc | ||
Kconfig.stdio | ||
Makefile | ||
Makefile.dep | ||
Makefile.include |