The sysutils/xosview port that comes with 6.0 results in a memory leak that eventually crashes the xosview process. The CVS tree doesn't show any activity here more recent than 6.0. The attached extra patch to bsd/kernel.cc fixes the problem. Fix: + // keep track of the mem we're given: + base_intrcnt = kvm_intrcnt; + base_intrname = kvm_intrname; + safe_kvm_read (nlst[INTRCNT_SYM_INDEX].n_value, kvm_intrcnt, intrcntlen); safe_kvm_read (nlst[INTRNAMES_SYM_INDEX].n_value, kvm_intrname, inamlen); @@ -1035,6 +1039,10 @@ kvm_intrcnt++; kvm_intrname += strlen(kvm_intrname) + 1; } + + // Doh! somebody needs to free this stuff too... (pavel 20-Jan-2006) + free(base_intrcnt); + free(base_intrname); #endif #elif defined (XOSVIEW_BSDI) int nintr = 16;--A60CKLRK1DhKadbiyt4A2Ej67DHW5kNl9hjerhPhLdExB1Of Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- work/xosview-1.8.2/bsd/kernel.cc.save Thu Jan 19 14:26:39 2006 +++ work/xosview-1.8.2/bsd/kernel.cc Fri Jan 20 16:35:35 2006 @@ -1006,8 +1006,8 @@ } #else /* FreeBSD 5.x and 6.x */ /* This code is stolen from vmstat */ - unsigned long *kvm_intrcnt; - char *kvm_intrname; + unsigned long *kvm_intrcnt, *base_intrcnt; + char *kvm_intrname, *base_intrname; size_t inamlen, intrcntlen; unsigned int i, nintr; int d; @@ -1020,6 +1020,10 @@ ((kvm_intrname = (char *)malloc(inamlen)) == NULL)) err(1, "malloc()");
Responsible Changed From-To: freebsd-ports-bugs->clsung Over to maintainer
State Changed From-To: open->closed Committed. Thank You.