Skip to content

stdlib: fix async ORC resource leaks#25683

Open
lbcheng888 wants to merge 1 commit intonim-lang:develfrom
lbcheng888:codex/default-user-async-orc-leaks
Open

stdlib: fix async ORC resource leaks#25683
lbcheng888 wants to merge 1 commit intonim-lang:develfrom
lbcheng888:codex/default-user-async-orc-leaks

Conversation

@lbcheng888
Copy link
Copy Markdown
Contributor

Summary

  • release dispatcher-owned resources when replacing or closing dispatchers
  • free the kqueue selector backend shared changes array
  • fix Windows AsyncEvent registration lifetime handling

Testing

./bin/nim c -r --mm:orc tests/async/tasyncdispatch_dispatcher_fdleak.nim
./bin/nim c -r --threads:on -d:threadsafe --mm:orc tests/async/tioselectors_memleak.nim
./bin/nim c -r --threads:on --mm:orc tests/async/tasyncevent_memleak.nim
./bin/nim c -r --mm:orc -d:useMalloc tests/arc/tasyncorc.nim

Release dispatcher-owned resources when replacing or closing dispatchers, free the kqueue selector shared changes array, and fix Windows AsyncEvent registration lifetime handling.

Add regression tests covering dispatcher FD cleanup, kqueue shared-memory cleanup, and AsyncEvent leak scenarios.
@Araq
Copy link
Copy Markdown
Member

Araq commented Mar 30, 2026

Category: async
Name: tests/async/tasyncevent_memleak.nim c
Action: run
Result: reOutputsDiffer
-------- Expected -------
0
--------- Given --------
23984


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants