Skip to content

feat(process): add timer cleanup on process exit#1797

Merged
fslongjin merged 2 commits intoDragonOS-Community:masterfrom
fslongjin:fix-process-exit-timer-cleanup
Mar 1, 2026
Merged

feat(process): add timer cleanup on process exit#1797
fslongjin merged 2 commits intoDragonOS-Community:masterfrom
fslongjin:fix-process-exit-timer-cleanup

Conversation

@fslongjin
Copy link
Copy Markdown
Member

@fslongjin fslongjin commented Feb 26, 2026

  • Implementexit_timers()method to clean up alarm, itimer, and POSIX timers
  • Addtimer_ids()method to iterate over POSIX timer IDs
  • Refactor alarm timer to use weak reference to PCB for safety
  • Change symlink resolution from recursive to iterative approach

- Implement`exit_timers()`method to clean up alarm, itimer, and POSIX timers
- Add`timer_ids()`method to iterate over POSIX timer IDs
- Refactor alarm timer to use weak reference to PCB for safety

Signed-off-by: longjin <longjin@DragonOS.org>
@github-actions github-actions Bot added the enhancement New feature or request label Feb 26, 2026
do_lookup_follow_symlink() previously followed symlinks via recursive
calls to lookup_follow_symlink2(), with up to 40 levels of recursion.
Each stack frame allocated a 256-byte read buffer, multiple Strings,
and metadata queries, causing kernel stack overflow when deeply nested
symlinks were encountered (e.g. gVisor ExecTest.SymlinkLimitExceeded).

Replace the recursive approach with an iterative loop that updates
result, rest_path, and a symlink_follows_remaining counter in-place.
Absolute symlink targets restart resolution from process_root_inode;
relative targets continue from the current directory. Stack usage is
now O(1) regardless of symlink nesting depth.

Signed-off-by: longjin <longjin@DragonOS.org>
@fslongjin fslongjin merged commit 2f6e86f into DragonOS-Community:master Mar 1, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant