From owner-freebsd-bugs@FreeBSD.ORG Thu May 15 22:50:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEDD533A for ; Thu, 15 May 2014 22:50:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 A22AC2BE7 for ; Thu, 15 May 2014 22:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FMo06b025898 for ; Thu, 15 May 2014 22:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4FMo0EV025893; Thu, 15 May 2014 22:50:00 GMT (envelope-from gnats) Resent-Date: Thu, 15 May 2014 22:50:00 GMT Resent-Message-Id: <201405152250.s4FMo0EV025893@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Myron Walker Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BDA52F2 for ; Thu, 15 May 2014 22:44:18 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED91B2BCA for ; Thu, 15 May 2014 22:44:17 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FMiGNQ090510 for ; Thu, 15 May 2014 22:44:16 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s4FMiGIh090509; Thu, 15 May 2014 22:44:16 GMT (envelope-from nobody) Message-Id: <201405152244.s4FMiGIh090509@cgiserv.freebsd.org> Date: Thu, 15 May 2014 22:44:16 GMT From: Myron Walker To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/189845: UnNecessary Copy of Error Buffer in _kvm_open X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 22:50:00 -0000 >Number: 189845 >Category: misc >Synopsis: UnNecessary Copy of Error Buffer in _kvm_open >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 15 22:50:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Myron Walker >Release: >Organization: EMC >Environment: mwwsoftcluster0# uname -a FreeBSD mwwsoftcluster0 11.0-CURRENT FreeBSD 11.0-CURRENT #0: Mon May 5 10:30:09 PDT 2014 root@bsd10build01.west.isilon.com:/build/mnt/obj/build/mnt/src/sys/IQ.amd64.debug amd64 >Description: _kvm_open in libkvm always returns 0 on a failure. So writing a message to kd is pointless because it is immediately passed to kvm_close() and the memory is freed. Se the code snippet below from _kvm_open. /* * Copy out the error if doing sane error semantics. */ if (errout != 0) strlcpy(errout, kd->errbuf, _POSIX2_LINE_MAX); (void)kvm_close(kd); return (0); >How-To-Repeat: >Fix: All error message code can be removed from _kvm_open because none of it is used anyway. >Release-Note: >Audit-Trail: >Unformatted: