From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 17:31:18 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97372D8E for ; Sun, 26 Apr 2015 17:31:18 +0000 (UTC) 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 819671DF5 for ; Sun, 26 Apr 2015 17:31:18 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QHVIiO000278 for ; Sun, 26 Apr 2015 17:31:18 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 17:31:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: smh@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 17:31:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Steven Hartland changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smh@FreeBSD.org --- Comment #2 from Steven Hartland --- Looks like it needs a little more than that, as with just your patch it could free more than once. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 18:25:23 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C7859E for ; Sun, 26 Apr 2015 18:25:23 +0000 (UTC) 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 CCDFC1278 for ; Sun, 26 Apr 2015 18:25:23 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QIPNVY026109 for ; Sun, 26 Apr 2015 18:25:23 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 18:25:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 18:25:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155951|0 |1 is obsolete| | --- Comment #3 from Pedro F. Giffuni --- Created attachment 156014 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=156014&action=edit Fix avoiding double free Thanks! Quick fix. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 18:40:29 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D78D46FE for ; Sun, 26 Apr 2015 18:40:29 +0000 (UTC) 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 C206D1450 for ; Sun, 26 Apr 2015 18:40:29 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QIeTqO041761 for ; Sun, 26 Apr 2015 18:40:29 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 18:40:30 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: smh@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 18:40:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #4 from Steven Hartland --- Why not just move the free out the loop? -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 19:22:22 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632A6BB0 for ; Sun, 26 Apr 2015 19:22:22 +0000 (UTC) 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 4D79D185B for ; Sun, 26 Apr 2015 19:22:22 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QJMMUk022247 for ; Sun, 26 Apr 2015 19:22:22 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 19:22:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 19:22:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156014|0 |1 is obsolete| | --- Comment #5 from Pedro F. Giffuni --- Comment on attachment 156014 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=156014 Fix avoiding double free (In reply to Steven Hartland from comment #4) I think assigning the NULLs is actually unnecessary: all the occasions where scan_info is free'd go to a break. The first patch seems fine. Moving the free() out of the loop would be a possibility but seems better to release the memory as soon as it is used, and I suspect that's what the author had in mind. OTOH, but this is just me, I prefer to avoid modifying existing code since this is not something I can test. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 19:23:01 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA5A5BFC for ; Sun, 26 Apr 2015 19:23:01 +0000 (UTC) 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 C4D321860 for ; Sun, 26 Apr 2015 19:23:01 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QJN1Vq022721 for ; Sun, 26 Apr 2015 19:23:01 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 19:23:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 19:23:01 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155951|1 |0 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 23:09:21 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AE78663 for ; Sun, 26 Apr 2015 23:09:21 +0000 (UTC) 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 854C11D75 for ; Sun, 26 Apr 2015 23:09:21 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QN9LYs031673 for ; Sun, 26 Apr 2015 23:09:21 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 23:09:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: smh@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 23:09:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #6 from Steven Hartland --- Your missing he fact when they break out of the loop above. The leak will only occur when no break in above for loop happens, however in the common case where it does, your free will currently be a double free. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 23:29:18 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F393B837 for ; Sun, 26 Apr 2015 23:29:17 +0000 (UTC) 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 DE3681F17 for ; Sun, 26 Apr 2015 23:29:17 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QNTHdu049670 for ; Sun, 26 Apr 2015 23:29:17 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 23:29:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 23:29:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156014|1 |0 is obsolete| | --- Comment #7 from Pedro F. Giffuni --- Comment on attachment 156014 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=156014 Fix avoiding double free (In reply to Steven Hartland from comment #6) Bah.. yes you are right. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Sun Apr 26 23:30:22 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 553CF875 for ; Sun, 26 Apr 2015 23:30:22 +0000 (UTC) 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 3F6C21F21 for ; Sun, 26 Apr 2015 23:30:22 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3QNUMvM050807 for ; Sun, 26 Apr 2015 23:30:22 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Sun, 26 Apr 2015 23:30:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.description Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2015 23:30:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155951|0 |1 is obsolete| | Attachment #155951|Fix |Fix (incomplete) description| | -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 15:47:28 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4321FAA9 for ; Wed, 29 Apr 2015 15:47:28 +0000 (UTC) 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 2E1371FFF for ; Wed, 29 Apr 2015 15:47:28 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TFlSdg098621 for ; Wed, 29 Apr 2015 15:47:28 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 15:47:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 15:47:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #8 from commit-hook@freebsd.org --- A commit references this bug: Author: pfg Date: Wed Apr 29 15:46:58 UTC 2015 New revision: 282227 URL: https://svnweb.freebsd.org/changeset/base/282227 Log: Fix memory leak in scsi_scan_bus() CID: 1007770 PR: 199671 Changes: head/sys/cam/scsi/scsi_xpt.c -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 15:50:10 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8E5ABC2 for ; Wed, 29 Apr 2015 15:50:10 +0000 (UTC) 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 C344B10CF for ; Wed, 29 Apr 2015 15:50:10 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TFoATk099647 for ; Wed, 29 Apr 2015 15:50:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 15:50:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 15:50:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|New |Closed --- Comment #9 from Pedro F. Giffuni --- It looks pretty safe. Thank you Steven for the review! -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 18:13:59 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EA8B312 for ; Wed, 29 Apr 2015 18:13:59 +0000 (UTC) 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 68E2713A5 for ; Wed, 29 Apr 2015 18:13:59 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TIDxkE056776 for ; Wed, 29 Apr 2015 18:13:59 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 18:13:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 18:13:59 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |Not A Bug --- Comment #10 from Pedro F. Giffuni --- Patch reverted in r282239. False positive: Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x21000002d8 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff802fd074 stack pointer = 0x28:0xfffffe100678f960 frame pointer = 0x28:0xfffffe100678f9e0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 2 (doneq0) [ thread pid 2 tid 100025 ] Stopped at scsi_scan_bus+0x54: movq 0x58(%rax),%rdi db> bt Tracing pid 2 tid 100025 td 0xfffff8000d3ac940 scsi_scan_bus() at scsi_scan_bus+0x54/frame 0xfffffe100678f9e0 xpt_done_process() at xpt_done_process+0x521/frame 0xfffffe100678fa20 xpt_done_td() at xpt_done_td+0xf6/frame 0xfffffe100678fa70 fork_exit() at fork_exit+0x71/frame 0xfffffe100678fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe100678fab0 --- trap 0, rip = 0, rsp = 0xfffffe100678fb70, rbp = 0 --- db> -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 18:30:47 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 534F267C for ; Wed, 29 Apr 2015 18:30:47 +0000 (UTC) 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 3E8151597 for ; Wed, 29 Apr 2015 18:30:47 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TIUlg6085254 for ; Wed, 29 Apr 2015 18:30:47 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 18:30:47 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: smh@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 18:30:47 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #11 from Steven Hartland --- yer scan_info is still referenced in work_ccb, I should have spotted that apologies. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 18:40:01 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A36B2790 for ; Wed, 29 Apr 2015 18:40:01 +0000 (UTC) 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 8DF93169F for ; Wed, 29 Apr 2015 18:40:01 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TIe1Gv093229 for ; Wed, 29 Apr 2015 18:40:01 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 18:40:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 18:40:01 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #12 from Pedro F. Giffuni --- (In reply to Steven Hartland from comment #11) Not really your fault: I have been trusting too much the static analyzers lately, and they clearly may miss things, *especially* in the kernel. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 20:32:31 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8D64E64 for ; Wed, 29 Apr 2015 20:32:31 +0000 (UTC) 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 D3E4C139A for ; Wed, 29 Apr 2015 20:32:31 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TKWVwH066912 for ; Wed, 29 Apr 2015 20:32:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 20:32:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cartwright@asu.edu X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 20:32:32 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 cartwright@asu.edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cartwright@asu.edu --- Comment #13 from cartwright@asu.edu --- Perhaps a comment should be added to the source code indicating why it the analysis is a false positive. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Wed Apr 29 23:05:58 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2285193 for ; Wed, 29 Apr 2015 23:05:58 +0000 (UTC) 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 8CB79147C for ; Wed, 29 Apr 2015 23:05:58 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3TN5wXF037493 for ; Wed, 29 Apr 2015 23:05:58 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Wed, 29 Apr 2015 23:05:58 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 23:05:58 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 --- Comment #14 from Pedro F. Giffuni --- (In reply to cartwright from comment #13) Comments for things that don't exist and don't help development in any way are generally considered noise. There is the commit history and this bug report which serve as reference. The bug is in the static analyzer so I annotated it in Coverity. Clang doesn't currently have tags for this type of errors. Of course if many people are looking at the issue and repeatedly try to fix what is not broken it may be better to add a comment but we currently don't have many people checking those reports (most FreeBSD developers are indeed perfect ;) ). -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Thu Apr 30 00:21:19 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53841DFA for ; Thu, 30 Apr 2015 00:21:19 +0000 (UTC) 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 3E1321C07 for ; Thu, 30 Apr 2015 00:21:19 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3U0LJqh084158 for ; Thu, 30 Apr 2015 00:21:19 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Thu, 30 Apr 2015 00:21:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: scottl@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 00:21:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Scott Long changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |scottl@FreeBSD.org --- Comment #15 from Scott Long --- The clang static analyzer wasn't wrong. It's possible to leak the scan_info object if the conditions for the 'for' loop prevent the loop from being entered. It's not a normal occurrence in real life, but it's not impossible either. What needs to happen is that the loop increment a reference counter on scan_info, and if at the exit of the loop the refcount is 0, then free scan_info. It's not a bug in clang, and it's probably not in Coverity either, but I haven't looked at the output from that. Please don't file it as a bug with those projects. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Thu Apr 30 00:29:24 2015 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A215F2DE for ; Thu, 30 Apr 2015 00:29:24 +0000 (UTC) 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 8D19D1D28 for ; Thu, 30 Apr 2015 00:29:24 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t3U0TOdK087628 for ; Thu, 30 Apr 2015 00:29:24 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-scsi@FreeBSD.org Subject: [Bug 199671] [patch] memory leak in cam scsi Date: Thu, 30 Apr 2015 00:29:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pfg@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-scsi@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 00:29:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199671 Pedro F. Giffuni changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|Not A Bug |Rejected --- Comment #16 from Pedro F. Giffuni --- (In reply to Scott Long from comment #15) OK, I un-flagged it as "false positive" in Coverity. There was never a bug report as those projects are pretty much used to having both false-positives and true-positives that are tagged incorrectly as false-positives. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-scsi@FreeBSD.ORG Fri May 1 13:41:20 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 689A63C2 for ; Fri, 1 May 2015 13:41:20 +0000 (UTC) Received: from clavin1.langille.org (clavin.langille.org [162.208.116.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "clavin.langille.org", Issuer "StartCom Class 2 Primary Intermediate Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2275018D0 for ; Fri, 1 May 2015 13:41:19 +0000 (UTC) Received: from (clavin1.int.langille.org (clavin1.int.unixathome.org [10.4.7.7]) (Authenticated sender: hidden) with ESMTPSA id D47353FD0 for ; Fri, 1 May 2015 13:41:17 +0000 (UTC) From: Dan Langille X-Pgp-Agent: GPGMail 2.5b6 Content-Type: multipart/signed; boundary="Apple-Mail=_37ADCC97-46FE-4014-B903-C3A89C179F20"; protocol="application/pgp-signature"; micalg=pgp-sha512 Subject: Dud tapes Date: Fri, 1 May 2015 09:41:17 -0400 Message-Id: To: freebsd-scsi@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) X-Mailer: Apple Mail (2.2098) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2015 13:41:20 -0000 --Apple-Mail=_37ADCC97-46FE-4014-B903-C3A89C179F20 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I'm using Bacula 7.0.5 on FreeBSD 10.1 (bacula-dir) and FreeBSD 9.3 = (bacula-sd). Sometimes I get dud tapes. Or at least, tapes my tape drive does not = like. For example: ### 01-May 09:39 crey-sd JobId 205441: End of Volume "FAI022" at 11:11326 on = device "DTL03" (/dev/nsa0). Write of 64512 bytes got 49152. 01-May 09:39 crey-sd JobId 205441: Error: Error writing final EOF to = tape. This Volume may not be readable. tape_dev.c:941 ioctl MTWEOF error on "DTL03" (/dev/nsa0). = ERR=3DInput/output error. 01-May 09:39 crey-sd JobId 205441: End of medium on Volume "FAI022" = Bytes=3D10,784,406,528 Blocks=3D167,168 at 01-May-2015 09:39. 01-May 09:39 crey-sd JobId 205441: 3307 Issuing autochanger "unload slot = 2, drive 0" command. ### See also, this from /var/log/messages: ### May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): WRITE FILEMARKS(6). CDB: = 10 00 00 00 01 00 May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): CAM status: SCSI Status = Error May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): SCSI status: Check = Condition May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): SCSI sense: MEDIUM ERROR = asc:c,0 (Write error) May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): Command Specific Info: = 0x28b4b May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): Error 5, Retries = exhausted May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): WRITE FILEMARKS(6). CDB: = 10 00 00 00 02 00 May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): CAM status: SCSI Status = Error May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): SCSI status: Check = Condition May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): SCSI sense: MEDIUM ERROR = asc:c,0 (Write error) May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): Command Specific Info: = 0x28b4b May 1 09:39:01 knew kernel: (sa0:sym0:0:1:0): Error 5, Retries = exhausted May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): WRITE FILEMARKS(6). CDB: = 10 00 00 00 01 00 May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): CAM status: SCSI Status = Error May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): SCSI status: Check = Condition May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): SCSI sense: MEDIUM ERROR = asc:c,0 (Write error) May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): Command Specific Info: = 0x11fb May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): Error 5, Retries = exhausted May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): WRITE FILEMARKS(6). CDB: = 10 00 00 00 02 00 May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): CAM status: SCSI Status = Error May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): SCSI status: Check = Condition May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): SCSI sense: MEDIUM ERROR = asc:c,0 (Write error) May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): Command Specific Info: = 0x11fb May 1 09:42:41 knew kernel: (sa0:sym0:0:1:0): Error 5, Retries = exhausted ### In this case, I will mark the tape as DISABLED and once it is past it's = recycling date, I will retire the tape. Best practice might be to rerun the backup, but this backup is also on = disk. What do you usually do with tapes such as this? Is this tape or = hardware? =E2=80=94 Dan Langille http://langille.org/ --Apple-Mail=_37ADCC97-46FE-4014-B903-C3A89C179F20 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQJ8BAEBCgBmBQJVQ4J+XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ1MTE2RjM0ODIzRDdERDM4OTY0OUJBNzdF QjIxNTlERUU5NzI3MzlGAAoJEOshWd7pcnOf0T0P/37tEIWFClMIp2vhG1ZvF58M cznvfxi62YbHSQsg/qEgRvFp6JD8Vz+Zus7HjUwhJkqIX4trjab+RN0Ff+Yv2u2M Jfnw8tHb3v+uX6C+fqzMkAQxl+m2Eyep2odayCkReUg2hgdMBLZbCQmFOPGhb4wf 4tE4k+oxi5hjyz5QoBnhqCpAhDM9NCLiyLavckQuvFcCEzWcNtuRBqaJEKhw893J /cSKIW7kvgNtfHughoevoXLmOzywG8KKbMi862IbgP9KHyGpzR6FnDYbKx4cVZbk 8Val2J6baPXvCzGCsg1BmUxgVKcKYCSN/5isbqRpxtrqG74Ub2AQHIv6yqcPro4T AUIE9DmcSZsZ80xNpj/YPYmt1w5LXaiGlvvYZnp7uokeNOP0iv/Oee9W3d6BODMh kLKvPfDtcBkjpc6ZnwQ79TqQzxtNky1SpUZXLmVLVZlyKJ4Jwz5I/THBl3RfOEfo I1xHKfJccot0L97+BcemEMFPUpwFAbOUfgID01vZyNM3jRxJBgKkPiJp0LA16Ieb k7cEnyyrfGoMPztkfD5y/XU7C0fLkSiYqmLre5RNj75nEAkpzT29oRmsaO09i6KN aXVnk9x1Z86K043WG5Od4mUz/LK/fkMQMWoCjQzMygXk4AiPdEfbxO55n1oZP0WE mKQ0NdP846y+RvqGETOm =EgXd -----END PGP SIGNATURE----- --Apple-Mail=_37ADCC97-46FE-4014-B903-C3A89C179F20-- From owner-freebsd-scsi@FreeBSD.ORG Fri May 1 22:52:01 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 821) id 45899F1E; Fri, 1 May 2015 22:52:01 +0000 (UTC) Date: Fri, 1 May 2015 22:52:01 +0000 From: John To: FreeBSD-SCSI Subject: 9300-16e does not see 6G shelf Message-ID: <20150501225201.GA8570@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2015 22:52:01 -0000 Hi Folks, I'm running 10-STABLE with some LSI (Avago) 9300-16e HBA cards with the mpr driver. These cards work great with 12G shelves (system & shelves from SuperMicro). However, if I hook a set of 6G shelves from a system using LSI 9207-8e HBA cards (a nicely working config), the mpr driver complains that no active slots are found and the shelf is not registered - leading to no drives being discovered. I am not mixing speeds on the bus. I'm using only 6G shelves in this configuration. The shelf information from a 9207 based system: ses0 at mps1 bus 0 scbus7 target 169 lun 0 ses0: Fixed Enclosure Services SCSI-5 device ses0: 600.000MB/s transfers ses0: Command Queueing enabled ses0: SCSI-3 SES Device From the system with the 9300-16e cards (verbose boot): mpr0: port 0xf000-0xf0ff mem 0xfbd40000-0xfbd4ffff,0xfbd00000-0xfbd3ffff irq 56 at device 0.0 on pci132 mpr0: IOCFacts : MsgVersion: 0x205 HeaderVersion: 0x2300 IOCNumber: 0 IOCExceptions: 0x0 MaxChainDepth: 128 NumberOfPorts: 1 RequestCredit: 10112 ProductID: 0x2221 IOCRequestFrameSize: 32 MaxInitiators: 32 MaxTargets: 1024 MaxSasExpanders: 64 MaxEnclosures: 65 HighPriorityCredit: 120 MaxReplyDescriptorPostQueueDepth: 65504 ReplyFrameSize: 32 MaxVolumes: 0 MaxDevHandle: 1128 MaxPersistentEntries: 128 mpr0: Firmware: 08.00.00.00, Driver: 05.255.05.00-fbsd mpr0: IOCCapabilities: 7a85c mpr0: attempting to allocate 1 MSI-X vectors (96 supported) msi: routing MSI-X IRQ 302 to local APIC 0 vector 100 mpr0: using IRQ 302 for MSI-X and then the following: mpr_mapping_enclosure_dev_status_change_event: enclosure with handle = 0x2 reported 0 slots _mapping_get_dev_info: failed to add the device with handle 0x000a because the enclosure is not in the mapping table _mapping_get_dev_info: failed to add the device with handle 0x000b because the enclosure is not in the mapping table _mapping_get_dev_info: failed to add the device with handle 0x000c because the enclosure is not in the mapping table _mapping_get_dev_info: failed to add the device with handle 0x000d because the enclosure is not in the mapping table _mapping_get_dev_info: failed to add the device with handle 0x000e because the enclosure is not in the mapping table Followed by many more of the above messages for each of the disks. I've started looking at the Mpi2EventDataSasEnclDevStatusChange_t structure - and I'm not convinced it's filled out fully. I can drop the 9207 cards in the new system and things work fine - but I would like to use the newer cards if possible. Is there something I've missed? A configuration knob? Thoughts? Thanks, John From owner-freebsd-scsi@FreeBSD.ORG Fri May 1 23:02:46 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967651C4; Fri, 1 May 2015 23:02:46 +0000 (UTC) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0541935; Fri, 1 May 2015 23:02:46 +0000 (UTC) Received: by oift201 with SMTP id t201so79250345oif.3; Fri, 01 May 2015 16:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ieUzimk9VP0luthq4ARo3+fP5dV52yKLULQ6NRvAf/U=; b=vhI36fzJG52zyAXp0tDb7/KUgyXlGlyZzT4TzO7xeoD7lNh7AOnZ0+Oxt537zuzKaj SPrA0m9H96g0Tita61zmQNBtiLRyJpukvmGn5wghRPzpYOMshop8qJGZYa2V00tM/8A+ zyDcga2P6dUdmINTmAuXRbbPUT4+Wz4T+71E2DnQfn3xPtilSGt0VQjK1ndp0LH4zRI3 9IgsStbg3E+YuudFVeF0M9tvXOZqwEPCpkqarjelb+uuJQR9D/ir7Plc/zTdq9556Z7P qKX5jjzDvIt3YwYjN0slaStg7JMYPmLeMe5V793NhjwlWmTk67OFVBuVyBI47smqiZeh jjdw== MIME-Version: 1.0 X-Received: by 10.202.173.144 with SMTP id w138mr9247558oie.100.1430521365738; Fri, 01 May 2015 16:02:45 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.173.204 with HTTP; Fri, 1 May 2015 16:02:45 -0700 (PDT) In-Reply-To: <20150501225201.GA8570@FreeBSD.org> References: <20150501225201.GA8570@FreeBSD.org> Date: Fri, 1 May 2015 17:02:45 -0600 X-Google-Sender-Auth: GVTEnDoKH0ItND3ebS8oJ_heX4A Message-ID: Subject: Re: 9300-16e does not see 6G shelf From: Alan Somers To: John Cc: FreeBSD-SCSI Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2015 23:02:46 -0000 On Fri, May 1, 2015 at 4:52 PM, John wrote: > Hi Folks, > > I'm running 10-STABLE with some LSI (Avago) 9300-16e HBA > cards with the mpr driver. These cards work great with 12G > shelves (system & shelves from SuperMicro). > > However, if I hook a set of 6G shelves from a system > using LSI 9207-8e HBA cards (a nicely working config), the mpr > driver complains that no active slots are found and the shelf is > not registered - leading to no drives being discovered. > > I am not mixing speeds on the bus. I'm using only 6G shelves > in this configuration. > > The shelf information from a 9207 based system: > > ses0 at mps1 bus 0 scbus7 target 169 lun 0 > ses0: Fixed Enclosure Services SCSI-5 device > ses0: 600.000MB/s transfers > ses0: Command Queueing enabled > ses0: SCSI-3 SES Device > > From the system with the 9300-16e cards (verbose boot): > > mpr0: port 0xf000-0xf0ff mem 0xfbd40000-0xfbd4ffff,0xfbd00000-0xfbd3ffff irq 56 at device 0.0 on pci132 > mpr0: IOCFacts : > MsgVersion: 0x205 > HeaderVersion: 0x2300 > IOCNumber: 0 > IOCExceptions: 0x0 > MaxChainDepth: 128 > NumberOfPorts: 1 > RequestCredit: 10112 > ProductID: 0x2221 > IOCRequestFrameSize: 32 > MaxInitiators: 32 > MaxTargets: 1024 > MaxSasExpanders: 64 > MaxEnclosures: 65 > HighPriorityCredit: 120 > MaxReplyDescriptorPostQueueDepth: 65504 > ReplyFrameSize: 32 > MaxVolumes: 0 > MaxDevHandle: 1128 > MaxPersistentEntries: 128 > mpr0: Firmware: 08.00.00.00, Driver: 05.255.05.00-fbsd > mpr0: IOCCapabilities: 7a85c > mpr0: attempting to allocate 1 MSI-X vectors (96 supported) > msi: routing MSI-X IRQ 302 to local APIC 0 vector 100 > mpr0: using IRQ 302 for MSI-X > > > and then the following: > > > mpr_mapping_enclosure_dev_status_change_event: enclosure with handle = 0x2 reported 0 slots > _mapping_get_dev_info: failed to add the device with handle 0x000a because the enclosure is not in the mapping table > _mapping_get_dev_info: failed to add the device with handle 0x000b because the enclosure is not in the mapping table > _mapping_get_dev_info: failed to add the device with handle 0x000c because the enclosure is not in the mapping table > _mapping_get_dev_info: failed to add the device with handle 0x000d because the enclosure is not in the mapping table > _mapping_get_dev_info: failed to add the device with handle 0x000e because the enclosure is not in the mapping table > > Followed by many more of the above messages for each of the disks. > > I've started looking at the Mpi2EventDataSasEnclDevStatusChange_t > structure - and I'm not convinced it's filled out fully. > > I can drop the 9207 cards in the new system and things > work fine - but I would like to use the newer cards if possible. > > Is there something I've missed? A configuration knob? > > Thoughts? > > Thanks, > John This smells like another Slot Mapping problem. When you connect the 6G shelf, do you see any devices at all? I would expect that you see at least one, though it might be ses(4) instead of da(4). If this is the Slot Mapping problem, then it doesn't really have anything to do with 12G vs 6G. Rather, it's an issue with specific how SAS expanders report their phy info, and how the HBA firmware interprets it. The HBA firmware can use two different modes: persistent mapping or enclosure/slot mapping. By default, LSI's 6G HBAs used persistent mapping, but their 12G HBAs use device/slot mapping by default. This post explains how to change the HBA's mode. https://lists.freebsd.org/pipermail/freebsd-scsi/2014-December/006545.html -Alan