← index #780PR #1046
Likely Duplicate · high · value 5.933
QUERY · ISSUE

popen leaves zombie processes

openby protectivedadopened 2023-12-21updated 2024-10-12
bug

I discuss this here. The zombie processes make it hard to use if it is called continuously. I reverted to piping to file and reading the output.

CANDIDATE · PULL REQUEST

unix-ffi: Fixing behavior to avoid zombie threads.

openby klukoninopened 2025-09-25updated 2025-12-02

This commit is fixing this issue:
https://github.com/micropython/micropython-lib/issues/780
As discussed here https://github.com/orgs/micropython/discussions/13239

Now the pid of child thread will be stored and closed properly. Even with context manager.

3 comments
hodan121 · 2025-10-20

bump up

Josverl · 2025-10-20

It would be good to add a test for this functionality,
that also helps with maintaining stability over time.

Other tests for the ffi module live in the micropython repo under tests/ports/unix

you could take one of the other ffi_ tests as the base, and add example code to it.

klukonin · 2025-12-02

I'll update the PR.
Thanks for the ideas, folks =)

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