Cover Letter Detail
Show a cover letter.
GET /api/covers/19421/?format=api
{ "id": 19421, "url": "https://patchwork.libcamera.org/api/covers/19421/?format=api", "web_url": "https://patchwork.libcamera.org/cover/19421/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>", "date": "2024-01-21T03:59:36", "name": "[libcamera-devel,00/12] libcamera: Hardening against thread race conditions", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/cover/19421/mbox/", "series": [ { "id": 4149, "url": "https://patchwork.libcamera.org/api/series/4149/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4149", "date": "2024-01-21T03:59:36", "name": "libcamera: Hardening against thread race conditions", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4149/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/covers/19421/comments/", "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 696B2C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 21 Jan 2024 03:59:48 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3CAA662931;\n\tSun, 21 Jan 2024 04:59:47 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B3F461D30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 21 Jan 2024 04:59:45 +0100 (CET)", "from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 524C58D4;\n\tSun, 21 Jan 2024 04:58:33 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1705809587;\n\tbh=zZlxAAlvTAv7EwqxUZb1d/Hd1ai0KT5IedM0gVFsbUc=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=amMg+3Ark5rh0cPjJrBAc6WJ+9H0JA09Q/U1qbiaJkVtaLo/ISBf+YWmUOwa0UU7S\n\tPhjwCH3pnJkNBLE8SGxLoXze9MMfWLHj2F1pkSuuZ2xPt64Ktf76x0lPU4fKQCWW/c\n\t1RBQcQgLRBT6yjZTI4TH0ayCyPyz9UcDL4HrerCdd5WW06VrwgPodZqxvNerx28aJq\n\ttGQXg6QiUn7aHuyeYw3eNuuGfzlb3PNe+IR/QgxM3xA7EvpQQqPhSDSzJx+kAIJy+d\n\t+o/o+wECB50Rc1E9mN9VxcP8Ly1tjFYLLLp4QRbl7K8DGEzwhiHSYSFHS9VdBEB5aQ\n\tFSsw77O7aj1Jw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705809513;\n\tbh=zZlxAAlvTAv7EwqxUZb1d/Hd1ai0KT5IedM0gVFsbUc=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=ZjOIH90DxfYyNwynazwwvF6gwdp9/im03eJ3zOiDDmjauM6IS5g11QCx00OOf5IGl\n\tizuf9v7m46A6AwQuIDd8nTwx3HJ25XB4eMHK+elvW3+P+WtQRp0/QY7/9MOJqT1B8S\n\tO+vkFZIOUEo+LcsRRrWcNAJH3SOB96aHKipIwldY=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZjOIH90D\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 21 Jan 2024 05:59:36 +0200", "Message-ID": "<20240121035948.4226-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 00/12] libcamera: Hardening against thread\n\trace conditions", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Hello,\n\nBug https://bugs.libcamera.org/show_bug.cgi?id=208 reports a race\ncondition that is ultimately due to incorrect usage of the libcamera\nmulti-threading infrastructure by the soft ISP code under development.\nInstead of blaming the author of that code, I believe it shows we're not\ndoing well enough at communicating the threading requirements. This\npatch series is an attempt to improve the situation.\n\nlibcamera has a threading model that is documented. In particular, the\ndocumentation classifies functions as thread-safe, thread-bound and\nreentrant. Patch 01/12 starts by fixing a minor issue in the\ndocumentation of a thread-bound function that does not contain the\ncorrect reference.\n\nPatch 02/12 is a drive-by improvement that is, strictly speaking,\nunrelated to this series, but was developed at the same time.\n\nThe next two patches fix a first thread-related issues with the\nObject::deleteLater() function. Patch 03/12 extends a unit test to\ndisplay the issue, and patch 04/12 fixes it.\n\nPatches 05/12 to 10/12 continue with fixing various kinds of incorrect\ndeletion of objects in unit tests. It turned out that all the race\nconditions related to this patch series are in unit tests, libcamera\nitself isn't (as far as I could see) affected. This is good news, even\nif it means we haven't been careful enough when writing unit tests,\nwhich calls for improvements in that area in the future.\n\nPatches 11/12 and 12/12 finally add assertions to complain loudly about\nincorrect deletion of Object instances (11/12) and incorrect calling\ncontexts of thread-bound functions (12/12).\n\nOnly the thread-bound members of Object subclasses have been hardened,\nmore work is needed to extend this to individual members of other\nclasses (currently only DeviceEnumerator::enumerate()), and to classes\nthat are marked as thread-bound at the class level (IPCUnixSocket and\nV4L2VideoDevice).\n\nEven if V4L2VideoDevice isn't addressed directly by this series, and the\nbug report is related to usage of the V4L2VideoDevice class, I believe\nthe issue in the soft ISP code will be caught by the assertions added to\nthe EventNotifier class. Milan, would you be able to test this, and\nconfirm that libcamera now complains loudly ?\n\nLaurent Pinchart (12):\n libcamera: object: Fix thread-bound reference in documentation\n libcamera: signal: Replace object.h inclusion with forward declatation\n test: object-delete: Test deferred delete just before thread stops\n libcamera: thread: Ensure deferred deletion of all objects before\n stopping\n test: event-thread: Destroy Object from correct thread context\n test: message: Remove incorrect slow receiver test\n test: message: Destroy Object from correct thread context\n test: signal-threads: Destroy Object from correct thread context\n test: timer-thread: Move timer start from wrong thread to separate\n test\n test: timer-thread: Destroy Object from correct thread context\n libcamera: object: Document and ensure Object deletion constraints\n libcamera: object: Add and use thread-bound assertion\n\n include/libcamera/base/object.h | 2 +\n include/libcamera/base/signal.h | 3 +-\n src/libcamera/base/bound_method.cpp | 1 +\n src/libcamera/base/event_notifier.cpp | 6 +\n src/libcamera/base/object.cpp | 50 +++++++-\n src/libcamera/base/signal.cpp | 1 +\n src/libcamera/base/thread.cpp | 7 ++\n src/libcamera/base/timer.cpp | 10 +-\n test/event-thread.cpp | 38 +++++--\n test/ipa/ipa_interface_test.cpp | 1 +\n test/meson.build | 9 +-\n test/message.cpp | 54 +++------\n test/object-delete.cpp | 30 ++++-\n test/signal-threads.cpp | 24 ++--\n test/timer-fail.cpp | 107 ++++++++++++++++++\n test/timer-thread.cpp | 37 ++----\n .../module_ipa_proxy.h.tmpl | 1 +\n 17 files changed, 276 insertions(+), 105 deletions(-)\n create mode 100644 test/timer-fail.cpp\n\n\nbase-commit: 0d99f2de13faccf199e6c9e806702cb21d0b6c24" }