From owner-freebsd-stable@FreeBSD.ORG Fri Apr 25 13:03:25 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607AA106567C for ; Fri, 25 Apr 2008 13:03:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 37DAD8FC25 for ; Fri, 25 Apr 2008 13:03:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id DD9831A4D84; Fri, 25 Apr 2008 06:03:24 -0700 (PDT) From: John Baldwin To: freebsd-stable@freebsd.org, Luke Dean Date: Fri, 25 Apr 2008 08:54:20 -0400 User-Agent: KMail/1.9.7 References: <20080420101554.J57244@border.lukas.is-a-geek.org> In-Reply-To: <20080420101554.J57244@border.lukas.is-a-geek.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804250854.20524.jhb@freebsd.org> Cc: Subject: Re: kvm_open: kvm_nlist: No such file or directory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 13:03:25 -0000 On Sunday 20 April 2008 01:38:32 pm Luke Dean wrote: > A few weeks ago I did a source upgrade from 6.2 to 7-STABLE. I didn't > "make delete-old" so a bunch of old libraries and such were left lying > around causing problems when I rebuilt all my ports. I'd read about some > recent improvements to DDB and SCHED_ULE in 7-STABLE, and it's a miserable > snowy weekend in Seattle right now, so I decided I'd take this opportunity > to update my system to the latest 7-STABLE and get rid of those old > libraries properly this time. > > Now sysutils/wmmemmon and sysutils/wmcpuload stopped working. > Both die with: > kvm_open: kvm_nlist: No such file or directory > error extracting symbols > > I found two PRs for other ports (ascpu and wmcube-gdk) to fix similar > problems, but they seem to be related to 8-CURRENT. The solution in both > of these cases is to use sysctls instead of using kvm. > PR numbers are 119923 and 120142. > > My question is should the existing code work in 7-STABLE or do wmmemmon > and wmcpuload need to be changed to use sysctls? > They worked for me for a couple of weeks on 7-STABLE, but like I said, I > had old libraries lying around and some of the windowmaker stuff > chose to link to them. > I have since cleaned up my system and rebuilt (I believe) everything and > now the ports no longer work. > > This is what I believe is the offending code snippet from > sysutils/wmmemmon's mem_freebsd.c file: Yes, cp_time[] is no more. Make them use the sysctl (kern.cp_time) instead. > -------------------------------------------------------------- > static kvm_t *kvm_data = NULL; > static int pageshift; > static struct nlist nlst[] = { {"_cp_time"}, {"_cnt"}, {0} }; > > /* initialize function */ > void mem_init(void) > { > int pagesize = getpagesize(); > pageshift = 0; > > while (pagesize > 1) { > pageshift++; > pagesize >>= 1; > } > > kvm_data = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); > > if (kvm_data == NULL) { > fprintf(stderr, "can't open kernel virtual memory"); > exit(1); > } > kvm_nlist(kvm_data, nlst); > > if (nlst[0].n_type == 0 || nlst[1].n_type == 0) { > fprintf(stderr, "error extracting symbols"); > exit(1); > } > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" -- John Baldwin