Saagar Jha
c68e5ecf78
Fix some locking
2020-05-26 21:06:42 -07:00
Theodore Dubois
3795b289a5
Implement timer_create and timer_settime
...
Fixes #707
2020-05-10 12:12:47 -07:00
Theodore Dubois
c40ded9d4e
Fix wait4(WNOHANG) returning garbage instead of 0
...
This broke running shell commands in the background with &.
2020-05-04 00:08:29 -07:00
Theodore Dubois
d5de7ad218
Implement waitid
...
Go uses waitid with WNOWAIT to wait for child processes.
For #57
2020-05-03 18:31:28 -07:00
Theodore Dubois
95f6413813
Guard against zombie tasks in /proc/pid files
...
Found this while trying to fix git annex. If you interrupt it while it
tries to run ssh using a control master, the init process will die and
then hang during the exit process trying to close its FDs. If you then
run ps, as I did, you get an asan report in proc_pid_stat_show because
task->mm is bad.
2020-04-18 20:02:45 -07:00
Theodore Dubois
dcb19ff33a
Don't remove a zombie from its pgroup or session before it's reaped
2020-02-17 13:11:06 -08:00
Theodore Dubois
3f0e51f10f
Fix race on group->threads
2019-09-08 22:48:16 -07:00
Theodore Dubois
c4e9d92797
Implement all the funny cases for waitpid
2019-08-24 20:38:01 -07:00
Theodore Dubois
4abebda86c
Fix leak of queued signals
2019-08-24 15:16:30 -07:00
Theodore Dubois
ae689abff5
Require a siginfo when sending a signal
2019-06-22 20:48:49 -07:00
Matthew Merrill
47ea1e85de
remove status argument from halt_system ( #384 )
2019-05-15 20:10:47 -07:00
Theodore Dubois
779bae1fce
Reparent children to another thread in the group first
2019-05-11 22:27:38 -07:00
Theodore Dubois
7d030189d2
Zero out a tty's session when the session dies
2019-05-05 19:47:26 -07:00
Theodore Dubois
3b01daa41e
Only acquire a controlling tty if the tty has no session
2019-05-05 16:31:07 -07:00
Theodore Dubois
7a45420ac0
Make the session automatically restart
2019-05-05 09:21:13 -07:00
Theodore Dubois
c2aedb4773
Merge pull request #342 from saagarjha/master
...
Use list_for_each_entry_safe when reparenting children
2019-03-09 21:27:50 -08:00
Saagar Jha
a492a69ecc
Use list_for_each_entry_safe when reparenting children
2019-03-09 21:21:13 -08:00
Theodore Dubois
b9e753dc15
Fix a bizzare typo
2019-03-09 21:05:44 -08:00
Theodore Dubois
3ce1aef431
Fix UAF when exiting a process that was reparented
2019-02-19 06:50:09 -08:00
Theodore Dubois
93bc13d924
Fix tsan warnings
2019-02-04 18:53:42 -08:00
Theodore Dubois
7e4c9d45cb
Return 0 from wait with WNOHANG if child exists
2019-02-01 10:39:51 -08:00
Theodore Dubois
34c377c87d
Improve controlling tty reference counting
2019-01-31 17:57:12 -08:00
Theodore Dubois
e5ca15aeb2
Make SIGKILL work on a stopped process
2019-01-08 09:24:46 -05:00
Theodore Dubois
842da480bf
Correctly handle spurious wakeups in wait4
2019-01-07 11:40:49 -08:00
Theodore Dubois
c14eca8ae7
Fix a couple of segfaults in midnight commander
2019-01-06 17:13:34 -08:00
Theodore Dubois
5cfec48854
Separate out some components of struct mem into struct mm
2019-01-04 15:17:37 -08:00
Theodore Dubois
8478bf5b53
Implement stopping processes with signals
2019-01-01 12:54:26 -08:00
Theodore Dubois
6a0f7253db
Fix locking on children_rusage in reap_if_zombie
2019-01-01 12:31:42 -08:00
Theodore Dubois
1e3319c242
Don't return ECHILD from waitpid(-1) if there are children
2018-12-31 19:38:00 -08:00
Theodore Dubois
610e9a8295
Refactor exit management code
2018-12-31 18:03:20 -08:00
Theodore Dubois
6dca791a13
Fix memory leak of timers
2018-12-31 17:30:10 -08:00
Theodore Dubois
eb87fe2a64
Make sure the strace output from exit actually appears
2018-12-30 21:19:03 -08:00
Theodore Dubois
4af803d3db
Reparent children before destroying the task
2018-12-26 17:30:11 -08:00
Theodore Dubois
2e83bbe9fb
Fix some lock ordering issues
2018-12-26 12:11:07 -08:00
Theodore Dubois
f8028736b4
Make mounting filesystems possible
2018-12-22 19:38:41 -08:00
Theodore Dubois
b55de4d7d2
Improve the situation with waiting for threads
2018-12-20 19:20:19 -08:00
Theodore Dubois
aa47e74092
Use the exit signal passed to clone()
2018-12-20 19:19:56 -08:00
Theodore Dubois
952221fe0d
Allow waiting on children of a different thread
2018-12-19 15:15:15 -08:00
Theodore Dubois
c8468470b6
Return ECHILD from waitpid(-1) with no children
...
Fixes #204
2018-12-19 14:20:58 -08:00
Theodore Dubois
2297838700
Send SIGCHLD to parent of dead process
2018-12-19 13:39:45 -08:00
Theodore Dubois
f0767992f3
Implement reparenting
2018-12-07 18:46:01 -08:00
Theodore Dubois
2adc56625c
Make process group and session membership per-thread-group
2018-12-06 14:17:46 -08:00
Ryan Hileman
277dd12e49
implement futex timeouts
2018-11-14 12:13:35 -08:00
Theodore Dubois
3303edd723
Delete the process timer on exit
2018-11-14 02:54:28 +00:00
Theodore Dubois
3d52f2d01a
Make new condition implementation work on Darwin
2018-11-08 19:28:11 -08:00
Theodore Dubois
12ed53a493
Introduce a replacement for pthread conditions and use that to make exit_group work
2018-11-08 18:57:06 -08:00
Theodore Dubois
4a8efe8d01
Make various memory management things shared between threads
2018-10-07 13:02:15 -07:00
Theodore Dubois
310a77ab3a
Implement CLONE_CHILD_CLEARTID
2018-10-05 16:42:16 -07:00
Theodore Dubois
cb1c658598
Fix some incorrect locking
2018-10-01 14:48:27 -07:00
Theodore Dubois
fd7d640abd
Fix a bunch of issues reported by static analyzers
2018-10-01 11:02:10 -07:00