Commit ae28b35
authored
fix(process): serialize non-leader exec handoff (#2156)
Model non-leader exec as an owned group-exec transaction that serializes sibling teardown, old-leader exit, fatal cancellation, identity migration, and observer visibility.
Atomically preserve PID/TGID/PGID/SID membership, raw-PID lookup, cgroup placement, parent-child ownership, ptrace relations, pidfd identity, session state, and accumulated resource usage across the leader handoff.
Align wait, SIGCHLD, ptrace exit notification, fatal thread-group signals, and process-group delivery with Linux 6.6 semantics. Preserve exited-thread CPU accounting and publish child-exit state before waking signal and wait observers.
Serialize controlling-TTY ownership and PTY peer lifetime transitions to prevent stale session updates, duplicate group signals, premature ctty removal, and slave-open races.
Add deterministic dunitest coverage for non-leader exec identity, pidfd visibility, fatal-signal races, wait ownership, resource accounting, process groups, ptrace siginfo, and PTY lifetime behavior.
Fixes #2153
Signed-off-by: longjin <longjin@dragonos.org>1 parent e374b45 commit ae28b35
28 files changed
Lines changed: 2666 additions & 618 deletions
File tree
- kernel/src
- driver/tty
- pty
- ipc
- process
- manager
- syscall
- user/apps/tests/dunitest/suites/normal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
817 | 824 | | |
818 | 825 | | |
819 | 826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| |||
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 281 | + | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
| |||
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
293 | | - | |
294 | | - | |
295 | 292 | | |
296 | 293 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | 294 | | |
301 | 295 | | |
302 | 296 | | |
| |||
666 | 660 | | |
667 | 661 | | |
668 | 662 | | |
| 663 | + | |
| 664 | + | |
669 | 665 | | |
670 | 666 | | |
671 | 667 | | |
| |||
875 | 871 | | |
876 | 872 | | |
877 | 873 | | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
878 | 879 | | |
879 | 880 | | |
880 | 881 | | |
| |||
1094 | 1095 | | |
1095 | 1096 | | |
1096 | 1097 | | |
1097 | | - | |
| 1098 | + | |
| 1099 | + | |
1098 | 1100 | | |
1099 | 1101 | | |
1100 | 1102 | | |
1101 | 1103 | | |
1102 | 1104 | | |
1103 | 1105 | | |
1104 | | - | |
1105 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1106 | 1113 | | |
1107 | 1114 | | |
1108 | 1115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
366 | 357 | | |
367 | 358 | | |
368 | 359 | | |
| |||
0 commit comments