From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Sep 6 07:40:02 2007 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADCD516A420 for ; Thu, 6 Sep 2007 07:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC0413C46A for ; Thu, 6 Sep 2007 07:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l867e2eC046235 for ; Thu, 6 Sep 2007 07:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l867e2Ev046233; Thu, 6 Sep 2007 07:40:02 GMT (envelope-from gnats) Resent-Date: Thu, 6 Sep 2007 07:40:02 GMT Resent-Message-Id: <200709060740.l867e2Ev046233@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, KOIE Hidetaka Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF8516A417 for ; Thu, 6 Sep 2007 07:36:09 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E4C1C13C458 for ; Thu, 6 Sep 2007 07:36:08 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l867a8AW055162 for ; Thu, 6 Sep 2007 07:36:08 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l867a8pJ055161; Thu, 6 Sep 2007 07:36:08 GMT (envelope-from nobody) Message-Id: <200709060736.l867a8pJ055161@www.freebsd.org> Date: Thu, 6 Sep 2007 07:36:08 GMT From: KOIE Hidetaka To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/116144: ganglia crashes frequently X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2007 07:40:02 -0000 >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: