Menu

#220 remove_event_detect() may produce a memory access error - system exit

New
None
High
Defect
2024-12-13
2024-12-13
Oliver Maye
No

After ramping up and running a GPIO pin in input direction and using interrupts, the sutdown procedure terminates abruptly when calling move_event_detect() with nothing more than "Memory access error" ("Speicherzugriffsfehler") written on the console.

I suggests focussing on py_gpio.c#py_remove_event_detect() around line #760. It seems as if the callback memory structures are free'd (in line #767) way before actually muting the interrupt through a call of remove_edge_detect() (in line #777). If an interrupt happens to occur right in between, the remaining code may refer to memory, that is actually released, already.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.