FreeBSD Bugzilla – Attachment 110494 Details for
Bug 151668
[maintainer-update] conky bugfix for the kvm_getprocs crash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
file.txt
file.txt (text/plain), 2.47 KB, created by
Nikos Ntarmos
on 2010-10-24 01:30:10 UTC
(
hide
)
Description:
file.txt
Filename:
MIME Type:
Creator:
Nikos Ntarmos
Created:
2010-10-24 01:30:10 UTC
Size:
2.47 KB
patch
obsolete
>--- Makefile.orig >+++ Makefile >@@ -7,6 +7,7 @@ > > PORTNAME= conky > PORTVERSION= 1.8.1 >+PORTREVISION= 1 > CATEGORIES= sysutils > MASTER_SITES= SF > >--- files/patch-src-conky.c.orig >+++ files/patch-src-conky.c >@@ -28,7 +28,23 @@ > #endif /* AUDACIOUS */ > > #ifdef BMPX >-@@ -6007,7 +6011,7 @@ >+@@ -5716,6 +5720,7 @@ >+ "kvm_open")) == NULL) { >+ CRIT_ERR(NULL, NULL, "cannot read kvm"); >+ } >++ pthread_mutex_init(&kvm_proc_mutex, NULL); >+ #endif >+ >+ while (1) { >+@@ -5999,6 +6004,7 @@ >+ >+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) >+ kvm_close(kd); >++ pthread_mutex_destroy(&kvm_proc_mutex); >+ #endif >+ >+ return 0; >+@@ -6007,7 +6013,7 @@ > > void alarm_handler(void) { > if(childpid > 0) { >--- files/patch-src-freebsd.c.orig >+++ files/patch-src-freebsd.c >@@ -0,0 +1,44 @@ >+--- src/freebsd.c.orig 2010-10-24 03:14:05.000000000 +0300 >++++ src/freebsd.c 2010-10-24 03:13:05.000000000 +0300 >+@@ -266,7 +266,9 @@ >+ { >+ int n_processes; >+ >++ pthread_mutex_lock(&kvm_proc_mutex); >+ kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); >++ pthread_mutex_unlock(&kvm_proc_mutex); >+ >+ info.procs = n_processes; >+ return 0; >+@@ -278,6 +280,7 @@ >+ int n_processes; >+ int i, cnt = 0; >+ >++ pthread_mutex_lock(&kvm_proc_mutex); >+ p = kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); >+ for (i = 0; i < n_processes; i++) { >+ #if (__FreeBSD__ < 5) && (__FreeBSD_kernel__ < 5) >+@@ -288,6 +291,7 @@ >+ cnt++; >+ } >+ } >++ pthread_mutex_unlock(&kvm_proc_mutex); >+ >+ info.run_procs = cnt; >+ return 0; >+@@ -748,6 +752,7 @@ >+ CRIT_ERR(NULL, NULL, "Cannot read sysctl \"vm.stats.vm.v_page_count\""); >+ } >+ >++ pthread_mutex_lock(&kvm_proc_mutex); >+ p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes); >+ processes = malloc(n_processes * sizeof(struct process)); >+ >+@@ -764,6 +769,7 @@ >+ j++; >+ } >+ } >++ pthread_mutex_unlock(&kvm_proc_mutex); >+ >+ qsort(processes, j - 1, sizeof(struct process), comparemem); >+ for (i = 0; i < 10 && i < n_processes; i++) { >--- files/patch-src-freebsd.h.orig >+++ files/patch-src-freebsd.h >@@ -0,0 +1,16 @@ >+--- src/freebsd.h.orig 2010-10-24 03:14:11.000000000 +0300 >++++ src/freebsd.h 2010-10-24 03:13:05.000000000 +0300 >+@@ -9,11 +9,13 @@ >+ #include <sys/ucred.h> >+ #include <fcntl.h> >+ #include <kvm.h> >++#include <pthread.h> >+ #if (defined(i386) || defined(__i386__)) >+ #include <machine/apm_bios.h> >+ #endif /* i386 || __i386__ */ >+ >+ kvm_t *kd; >++pthread_mutex_t kvm_proc_mutex; >+ >+ int get_entropy_avail(unsigned int *); >+ int get_entropy_poolsize(unsigned int *);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 151668
: 110494 |
110495