{"id":9016,"url":"https://patchwork.libcamera.org/api/1.1/patches/9016/?format=json","web_url":"https://patchwork.libcamera.org/patch/9016/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200727125317.23680-1-laurent.pinchart@ideasonboard.com>","date":"2020-07-27T12:53:17","name":"[libcamera-devel] test: process: Test Process::kill()","commit_ref":"b52fcf9b0f745fe0309c988fa550344378e3cfa0","pull_url":null,"state":"accepted","archived":false,"hash":"5eb9e3c6a04248eade8c50e644c6b537b2d9407b","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/9016/mbox/","series":[{"id":1151,"url":"https://patchwork.libcamera.org/api/1.1/series/1151/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1151","date":"2020-07-27T12:53:17","name":"[libcamera-devel] test: process: Test Process::kill()","version":1,"mbox":"https://patchwork.libcamera.org/series/1151/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/9016/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/9016/checks/","tags":{},"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 617A3BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jul 2020 12:53:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2A4B61253;\n\tMon, 27 Jul 2020 14:53:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79286605B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jul 2020 14:53:28 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D94A1556;\n\tMon, 27 Jul 2020 14:53:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Btgk82qm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1595854408;\n\tbh=CD8CVUiZ0udeYoSpTg2cA84GaYb9xPqX3XgXp1pFhy4=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=Btgk82qmh23NeR/gZ6BrSHiYMT8pvVggLArIwijGbrlx+0ozYq7qFKVuXcS/rGERp\n\txGgIYePf9Mdp/tdjHZ4ZJ+aLiZSVmXjFNP0kbXQGrWY1wJtyTgZJOb3NsJnTya4el2\n\tHfBtqfyxIWltMw5p4hCwOZPnFQ72Jp/z8u2YLTJc=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 27 Jul 2020 15:53:17 +0300","Message-Id":"<20200727125317.23680-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH] test: process: Test Process::kill()","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>","Cc":"You-Sheng Yang <vicamo.yang@canonical.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a test to ensure that Process::kill() on an unstarted process is\nsafe. This aims at ensuring we don't kill other processes unexpectedly.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/process/process_test.cpp | 4 ++++\n 1 file changed, 4 insertions(+)\n\nIf you want to try this at home *without* the corresponding fix to the\nProcess class (\"libcamera: process: Fix killing innocent processes\nunexpectedly\"), make sure to save all your work first. It's a very\neffective implementation of an ejection seat.","diff":"diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp\nindex ce0cc7c972cd..721a7c9d46ff 100644\n--- a/test/process/process_test.cpp\n+++ b/test/process/process_test.cpp\n@@ -51,6 +51,10 @@ protected:\n \t\targs.push_back(to_string(exitCode));\n \t\tproc_.finished.connect(this, &ProcessTest::procFinished);\n \n+\t\t/* Test that kill() on an unstarted process is safe. */\n+\t\tproc_.kill();\n+\n+\t\t/* Test starting the process and retrieving the exit code. */\n \t\tint ret = proc_.start(\"/proc/self/exe\", args);\n \t\tif (ret) {\n \t\t\tcerr << \"failed to start process\" << endl;\n","prefixes":["libcamera-devel"]}