I have 2 problems: (1) gmond in ganglia crashes by ABRT/SEGV. It seems memory corruption. (2)gmond reports wrong disk statistics. Fix: Patch attached with submission follows:
State Changed From-To: open->feedback Which port is this about?
Responsible Changed From-To: freebsd-ports-bugs->brooks Over to maintainer
State Changed From-To: feedback->open Feedback received
I'm sorry I haven't committed this yet. I've had a hard time finding enough to to figure out what the patch is doing. If you could resubmit a patch without the #if parts that would help me review it. Thanks, Brooks
The following is the patch without #if'ing. *** libmetrics/freebsd/metrics.c.orig 2008-01-04 14:20:14.328891831 +0900 --- libmetrics/freebsd/metrics.c 2008-01-04 14:26:16.108767439 +0900 *************** static int mibswap[MIB_SWAPINFO_SIZE]; *** 99,105 **** static size_t mibswap_size; static kvm_t *kd = NULL; static int pagesize; ! static int skipvfs; /* Function prototypes */ static long percentages(int cnt, int *out, register long *new, --- 99,105 ---- static size_t mibswap_size; static kvm_t *kd = NULL; static int pagesize; ! static int skipvfs = 1; /* Function prototypes */ static long percentages(int cnt, int *out, register long *new, *************** find_disk_space(double *total, double *t *** 865,871 **** netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); - free(netvfslist); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); --- 865,870 ---- *************** find_disk_space(double *total, double *t *** 883,888 **** --- 882,889 ---- *tot_avail += mntbuf[i].f_bavail / toru; } } + free(vfslist); + free(netvfslist); return most_full; } *************** makevfslist(fslist) *** 939,945 **** return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; ! skipvfs = 1; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') --- 940,946 ---- return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; ! skipvfs = 0; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') *************** makenetvfslist(void) *** 991,997 **** goto done; } ! for (cnt = 0; cnt < maxvfsconf; xvfsp++) { if (xvfsp->vfc_flags & VFCF_NONLOCAL) continue; --- 992,1001 ---- goto done; } ! cnt = 0; ! for (i = 0; i < maxvfsconf; i++, xvfsp++) { ! if (xvfsp->vfc_typenum == 0) ! continue; if (xvfsp->vfc_flags & VFCF_NONLOCAL) continue; *************** makenetvfslist(void) *** 1041,1050 **** * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ for (i = 0; i < cnt; i++) ! slen = strlen(listptr[i]) + 1; ! /* Add 2 for initial "no". */ ! slen += 2; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); --- 1045,1057 ---- * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ + slen = 0; for (i = 0; i < cnt; i++) ! slen += strlen(listptr[i]); ! /* for ',' */ ! slen += cnt - 1; ! /* Add 3 for initial "no" and the NUL. */ ! slen += 3; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); *************** makenetvfslist(void) *** 1053,1062 **** str[0] = 'n'; str[1] = 'o'; ! for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); - *strptr = ','; } *strptr = '\0'; --- 1060,1070 ---- str[0] = 'n'; str[1] = 'o'; ! for (i = 0, strptr = str + 2; i < cnt; i++) { ! if (i > 0) ! *strptr++ = ','; strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); } *strptr = '\0';
brooks 2009-01-30 23:01:39 UTC FreeBSD ports repository Modified files: sysutils/ganglia-monitor-core Makefile Added files: sysutils/ganglia-monitor-core/files patch-libmetrics_freebsd_metrics.c Log: At long last commit a patch to fix problems with disk statistic reporting and related crashes. Clean up a couple portlint nits at the same time. Submitted by: KOIE Hidetaka <koie at suri dot co dot jp> PR: ports/116144 Revision Changes Path 1.27 +3 -2 ports/sysutils/ganglia-monitor-core/Makefile 1.3 +83 -0 ports/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed, thanks! Sorry for taking so long to get this in.