Date: Thu, 6 Sep 2007 07:36:08 GMT From: KOIE Hidetaka <koie@suri.co.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/116144: ganglia crashes frequently Message-ID: <200709060736.l867a8pJ055161@www.freebsd.org> Resent-Message-ID: <200709060740.l867e2Ev046233@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 116144 >Category: ports >Synopsis: ganglia crashes frequently >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 06 07:40:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: KOIE Hidetaka >Release: 7.0-CURRENT >Organization: SURIGIKEN >Environment: FreeBSD sakura.suri.co.jp 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue Aug 21 15:31:51 JST 2007 koie@sakura.suri.co.jp:/usr/obj/usr/src/sys/SAKURA i386 >Description: I have 2 problems: (1) gmond in ganglia crashes by ABRT/SEGV. It seems memory corruption. (2)gmond reports wrong disk statistics. >How-To-Repeat: >Fix: Patch attached with submission follows: *** ../ganglia-3.0.4/libmetrics/freebsd/metrics.c.orig Thu Sep 6 01:21:28 2007 --- ../ganglia-3.0.4/libmetrics/freebsd/metrics.c Thu Sep 6 13:21:01 2007 *************** static int mibswap[MIB_SWAPINFO_SIZE]; *** 99,105 **** --- 99,109 ---- static size_t mibswap_size; static kvm_t *kd = NULL; static int pagesize; + #if 1 /*patch*/ + static int skipvfs = 1; + #else /*!patch*/ static int skipvfs; + #endif /*!patch*/ /* Function prototypes */ static long percentages(int cnt, int *out, register long *new, *************** find_disk_space(double *total, double *t *** 865,871 **** --- 869,878 ---- netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); + #if 1 /*patch*/ + #else /*!patch*/ /* vfslist[] points in netvfslist. */ free(netvfslist); + #endif /*!patch*/ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); *************** find_disk_space(double *total, double *t *** 883,888 **** --- 890,899 ---- *tot_avail += mntbuf[i].f_bavail / toru; } } + #if 1/*patch*/ + free(vfslist); + free(netvfslist); + #endif /*patch*/ return most_full; } *************** makevfslist(fslist) *** 939,945 **** --- 950,960 ---- return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; + #if 1 /*patch*/ + skipvfs = 0; + #else /*!patch*/ skipvfs = 1; + #endif /*!patch*/ } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') *************** makenetvfslist(void) *** 991,996 **** --- 1006,1027 ---- goto done; } + #if 1 /*patch*/ + cnt = 0; + for (i = 0; i < maxvfsconf; i++, xvfsp++) { + if (xvfsp->vfc_typenum == 0) + continue; + if (xvfsp->vfc_flags & VFCF_NONLOCAL) + continue; + + listptr[cnt] = strdup(xvfsp->vfc_name); + if (listptr[cnt] == NULL) { + warnx("malloc failed"); + goto done; + } + cnt++; + } + #else /*!patch*/ for (cnt = 0; cnt < maxvfsconf; xvfsp++) { if (xvfsp->vfc_flags & VFCF_NONLOCAL) continue; *************** makenetvfslist(void) *** 1002,1007 **** --- 1033,1039 ---- } cnt++; } + #endif /*!patch*/ #else int mib[3], maxvfsconf; size_t miblen; *************** makenetvfslist(void) *** 1041,1050 **** --- 1073,1092 ---- * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ + #if 1 /*patch*/ + 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; + #else /*!patch*/ for (i = 0; i < cnt; i++) slen = strlen(listptr[i]) + 1; /* Add 2 for initial "no". */ slen += 2; + #endif /*!patch*/ if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); *************** makenetvfslist(void) *** 1053,1064 **** --- 1095,1116 ---- str[0] = 'n'; str[1] = 'o'; + #if 1 /*patch*/ + for (i = 0, strptr = str + 2; i < cnt; i++) { + if (i > 0) + *strptr++ = ','; + strcpy(strptr, listptr[i]); + strptr += strlen(listptr[i]); + } + *strptr = '\0'; + #else /*!patch*/ /* extra comma at the tail of strptr. */ for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); *strptr = ','; } *strptr = '\0'; + #endif /*!patch*/ done: #if __FreeBSD_version > 500000 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709060736.l867a8pJ055161>