Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145414606
D54215.id168001.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54215.id168001.diff
View Options
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1065,8 +1065,6 @@
#ifdef MAC
mac_proc_init(newproc);
#endif
- newproc->p_klist = knlist_alloc(&newproc->p_mtx);
- STAILQ_INIT(&newproc->p_ktr);
/*
* Increment the count of procs running with this uid. Don't allow
@@ -1079,6 +1077,8 @@
chgproccnt(cred->cr_ruidinfo, 1, 0);
}
+ newproc->p_klist = knlist_alloc(&newproc->p_mtx);
+
do_fork(td, fr, newproc, td2, vm2, fp_procdesc);
error = 0;
goto cleanup;
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -244,7 +244,6 @@
#ifdef INVARIANTS
KASSERT((p->p_numthreads == 1),
("bad number of threads in exiting process"));
- KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr"));
#endif
/* Free all OSD associated to this thread. */
osd_thread_exit(td);
@@ -253,6 +252,7 @@
/* Make sure all thread destructors are executed */
EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td);
}
+ KASSERT(STAILQ_EMPTY(&p->p_ktr), ("proc_dtor: non-empty p_ktr"));
EVENTHANDLER_DIRECT_INVOKE(process_dtor, p);
#ifdef KDTRACE_HOOKS
kdtrace_proc_dtor(p);
@@ -281,6 +281,7 @@
p->p_stats = pstats_alloc();
p->p_pgrp = NULL;
TAILQ_INIT(&p->p_kqtim_stop);
+ STAILQ_INIT(&p->p_ktr);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 20, 1:30 PM (11 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28887043
Default Alt Text
D54215.id168001.diff (1 KB)
Attached To
Mode
D54215: proc: Fix proc_init / proc_dtor ordering issues
Attached
Detach File
Event Timeline
Log In to Comment