Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176948809
D31495.1793642573.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D31495.1793642573.diff
View Options
Index: sys/kern/kern_proc.c
===================================================================
--- sys/kern/kern_proc.c
+++ sys/kern/kern_proc.c
@@ -128,7 +128,7 @@
u_long pidhashlock;
struct pgrphashhead *pgrphashtbl;
u_long pgrphash;
-struct proclist allproc;
+struct proclist allproc = LIST_HEAD_INITIALIZER(allproc);
struct sx __exclusive_cache_line allproc_lock;
struct sx __exclusive_cache_line proctree_lock;
struct mtx __exclusive_cache_line ppeers_lock;
@@ -185,7 +185,6 @@
sx_init(&proctree_lock, "proctree");
mtx_init(&ppeers_lock, "p_peers", NULL, MTX_DEF);
mtx_init(&procid_lock, "procid", NULL, MTX_DEF);
- LIST_INIT(&allproc);
pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash);
pidhashlock = (pidhash + 1) / 64;
if (pidhashlock > 0)
Index: sys/kern/subr_kdb.c
===================================================================
--- sys/kern/subr_kdb.c
+++ sys/kern/subr_kdb.c
@@ -608,6 +608,10 @@
struct thread *thr;
u_int i;
+ /* This function may be called early. */
+ if (pidhashtbl == NULL)
+ return (&thread0);
+
for (i = 0; i <= pidhash; i++) {
LIST_FOREACH(p, &pidhashtbl[i], p_hash) {
thr = FIRST_THREAD_IN_PROC(p);
@@ -651,6 +655,8 @@
thr = TAILQ_NEXT(thr, td_plist);
if (thr != NULL)
return (thr);
+ if (pidhashtbl == NULL)
+ return (NULL);
hash = p->p_pid & pidhash;
for (;;) {
p = LIST_NEXT(p, p_hash);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 2, 6:02 PM (14 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41339140
Default Alt Text
D31495.1793642573.diff (1 KB)
Attached To
Mode
D31495: kdb: Handle process enumeration before procinit()
Attached
Detach File
Event Timeline