← index #7372Issue #7373
Related · high · value 2.131
QUERY · ISSUE

py: settrace is incompatible with Interrupt Handlers

openby amirgonopened 2021-06-08updated 2021-06-09
py-core

When MICROPY_PY_SYS_SETTRACE is enabled, bytecode execution allocates RAM, which is forbidden on interrupt handlers.

https://github.com/micropython/micropython/blob/4d9e657f0ee881f4a41093ab89ec91d03613744d/py/vm.c#L142-L149

https://github.com/micropython/micropython/blob/e9e9c76ddf131f8e50b0ae2d44501d3cd88537ef/py/profile.c#L315-L318

CANDIDATE · ISSUE

py: code_state heap allocation is incompatible with Interrupt Handlers

closedby amirgonopened 2021-06-08updated 2021-06-26
py-core

When running interrupt handler, memory allocation is forbidden but still happens if state_size is larger than VM_MAX_STATE_ON_STACK:

https://github.com/micropython/micropython/blob/4d9e657f0ee881f4a41093ab89ec91d03613744d/py/objfun.c#L267-L268

It's not clear how to completely avoid memory allocations in interrupt handlers if code_state is allocated on heap sometimes.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied