From owner-freebsd-toolchain@freebsd.org Thu May 11 00:13:15 2017 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF0DCD67840 for ; Thu, 11 May 2017 00:13:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 888DFAC7 for ; Thu, 11 May 2017 00:13:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v4B0DFlX066914 for ; Thu, 11 May 2017 00:13:15 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-toolchain@FreeBSD.org Subject: [Bug 219153] head, stable/11, release/11.0.1: libkvm (& more?) not updated to handle powerpc/powerpc64 ET_DYN based vmcore.* 's and such Date: Thu, 11 May 2017 00:13:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2017 00:13:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219153 --- Comment #9 from Mark Millard --- (In reply to John Baldwin from comment #5) As for ps -M /var/crash/vmcore.7 listing no processes: main uses kvm_getprocs, which in turn eventually does: if (KREAD(kd, nl[0].n_value, &nprocs)) { _kvm_err(kd, kd->program, "can't read nproc= s"); return (0); } but that ends up with: (gdb) print nprocs $2 =3D 12873340 (I checked the code and "info reg" and the value matched.) So things are already well messed up here. That in turn ends up used in: size =3D nprocs * sizeof(struct kinfo_proc); kd->procbase =3D (struct kinfo_proc *)_kvm_malloc(k= d, size); if (kd->procbase =3D=3D NULL) return (0); which succeeds but later there is: nprocs =3D kvm_deadprocs(kd, op, arg, nl[1].n_value, nl[2].n_value, nprocs); if (nprocs <=3D 0) { _kvm_freeprocs(kd); nprocs =3D 0; } which in kvm_deadprocs gets to: if (KREAD(kd, a_allproc, &p)) { _kvm_err(kd, kd->program, "cannot read allproc"); return (-1); } acnt =3D kvm_proclist(kd, what, arg, p, bp, maxcnt); if (acnt < 0) return (acnt); where: static int kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p, struct kinfo_proc *bp, int maxcnt) { int cnt =3D 0; . . . is used via: kvm_proclist (kd=3D0x41e14000, what=3D5, arg=3D0, p=3D0x0, bp=3D0x42000000, maxcnt=3D12873340) and the internal kvm_proclist loop no-ops because of p: for (; cnt < maxcnt && p !=3D NULL; p =3D LIST_NEXT(&proc, = p_list)) { So no process is listed. After the loop is: return (cnt); } And that means: nprocs =3D kvm_deadprocs(kd, op, arg, nl[1].n_value, nl[2].n_value, nprocs); if (nprocs <=3D 0) { _kvm_freeprocs(kd); nprocs =3D 0; } ends up with nprocs=3D=3D0 and kd is freed, hopefully including kd->procbase being freed (I did not look). But overall: at least one KREAD gets back a junk figure. And with that I think I will stop for this note. --=20 You are receiving this mail because: You are the assignee for the bug.=