From patchwork Tue Dec 13 09:37:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17991 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id EDE28C31E9 for ; Tue, 13 Dec 2022 09:38:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F32F63362; Tue, 13 Dec 2022 10:38:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670924294; bh=vv0hOqsNMAclIy7/4xQz5kNOt75lrj+0bisSZnrn12c=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BapAIYUonpWlBJUxP5+i2Y4V9KA7Xlh7WverwuajFpPJZdn+bRQrVlRn5zjkzCizM u3+0aIHp9DKgWcjnmeo82KQYcdTjeoO3rVEgZ09Q7mrjQrKQHv7cqi3XTk9N3w5xpJ CZEYwm4xVBJbHBQVWdtOOfAgfWLBeLWQ3pQhhjGV2nTcWz0aGDQM8BRLe73pzqU1vi qdoW8UMMRWKSv05E8UTDr9jSE9aua3CFFxE7bwtca/pPM7mw6ahypme06GM7oKQ167 ScSCUO+xi5mvV2UcOrQ+FwoZ6pDBKloKpW2rwjs7wx8rcKw4bFMrt6eR/Cv2+qRZIb qkvVSRpnKbnbA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C5FD36334D for ; Tue, 13 Dec 2022 10:38:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="e2Ge8Xl6"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B5204A7; Tue, 13 Dec 2022 10:38:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670924292; bh=vv0hOqsNMAclIy7/4xQz5kNOt75lrj+0bisSZnrn12c=; h=From:To:Cc:Subject:Date:From; b=e2Ge8Xl6eC85vJJNVF7NYgKDxrGLussR/Q3h2ECHxkbjliy/+7m2y6alJ9mVmYtRO fls+MKBj9Wp6THaML99cGkH89QdPX6qBM1MSowyW6rGhy65Pewk6V6wFPdHyHYcqYy 6hE5jLfvBLknzrxf3aHGO1yAhv54KUHNi9RkFjJc= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:37:59 +0900 Message-Id: <20221213093802.704177-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] lc-compliance: Fix SimpleCapture test X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series fixes bug 171 [1] *properly*. This issue was that a Request was reused and not queued to the Camera, then the buffers were freed before the Requests were destroyed, causing the Requests to cancel the freed buffers -> segfault. Technically this isn't an issue anymore because of "lc-compliance: simple_capture: Free Requests properly" [2], but still this fix is more proper. Fix this by reusing the Requests only if they will be queued to the Camera. Additionally, add a note about this issue to the application developer guide, and a todo regarding a potential race condition in Camera::queueRequest. [1] https://bugs.libcamera.org/show_bug.cgi?id=171 [2] https://git.libcamera.org/libcamera/libcamera.git/commit/?id=9a913eb9107483fcea01bd0e82c21e3733a5ddb2 Paul Elder (3): lc-compliance: simple_capture: Fix Request reuse Documentation: application-developer: Elaborate on request reuse libcamera: camera: Add todo for race condition on queueRequest Documentation/guides/application-developer.rst | 4 ++++ src/apps/lc-compliance/simple_capture.cpp | 2 +- src/libcamera/camera.cpp | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)