{"id":8997,"url":"https://patchwork.libcamera.org/api/1.1/patches/8997/?format=json","web_url":"https://patchwork.libcamera.org/patch/8997/","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":"<20200725122442.1679820-2-vicamo.yang@canonical.com>","date":"2020-07-25T12:24:40","name":"[libcamera-devel,1/3] libcamera: process: fix killing innocent processes unexpectedly","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"aa08ad3fa43e71e26d19a3da6d1a864d5a75ae67","submitter":{"id":61,"url":"https://patchwork.libcamera.org/api/1.1/people/61/?format=json","name":"You-Sheng Yang","email":"vicamo.yang@canonical.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8997/mbox/","series":[{"id":1145,"url":"https://patchwork.libcamera.org/api/1.1/series/1145/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1145","date":"2020-07-25T12:24:39","name":"fix test failures in package build systems","version":1,"mbox":"https://patchwork.libcamera.org/series/1145/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8997/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8997/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 44157BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 25 Jul 2020 13:03:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1ED9061384;\n\tSat, 25 Jul 2020 15:03:28 +0200 (CEST)","from mail-pl1-f195.google.com (mail-pl1-f195.google.com\n\t[209.85.214.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A4F5461223\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 25 Jul 2020 14:24:49 +0200 (CEST)","by mail-pl1-f195.google.com with SMTP id f7so1014111pln.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 25 Jul 2020 05:24:49 -0700 (PDT)","from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37])\n\tby smtp.gmail.com with ESMTPSA id\n\tn25sm9631393pff.51.2020.07.25.05.24.46\n\tfor <libcamera-devel@lists.libcamera.org>\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 25 Jul 2020 05:24:46 -0700 (PDT)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=ScdbYZrkdaR2xP65QRge/jc73B6q7JflgJPqSB4oq78=;\n\tb=gnFPC/dku6vG3liWiSe5vbazzYY4kjHgvIQG/gR2iuIaINqwwVTZqmKxfW/1JOZmIu\n\twt15WlgUn1R/qmgV9BHMtCr0dQHpABnqJAWwLM9XwVAQDKERIO65pGFDNkus64Er4Wfc\n\tGHJMth/+uGNrUV4tzyqJQ75lZrCqI/R1Cqic3RUIA6rsrIsUcgsxzIf0R9YqBiCp3QVF\n\tDRzACM85SAD7f9RMmdbH9Z0liJcpi+6Ph/8sBKizU6UPHZqHgh2zfbxfpJunAw0ZAAcD\n\tWHUsc+8UqOVBroNOO337BR05onmgyDltRm8+vWX7mQRefpOLLdcy7QRKMWDsKiUxb9xx\n\tdQpA==","X-Gm-Message-State":"AOAM531WD7VYNXqL7ZWT234nm4tRAqkldIkGwuJqS+9/6t1f4PG6Rh/w\n\ttq6xBwhDcqtK5UAKtQWk9IGo+vkQw/4=","X-Google-Smtp-Source":"ABdhPJy3F4tTVMmiIgPo8q+gg8ebqtv9eUu0GEnbjRVSYVUffc4JbGQJoPG9ScF0xjbpIV3NdYNFOA==","X-Received":"by 2002:a17:90a:c68e:: with SMTP id\n\tn14mr9507183pjt.182.1595679887714; \n\tSat, 25 Jul 2020 05:24:47 -0700 (PDT)","From":"You-Sheng Yang <vicamo.yang@canonical.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 25 Jul 2020 20:24:40 +0800","Message-Id":"<20200725122442.1679820-2-vicamo.yang@canonical.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200725122442.1679820-1-vicamo.yang@canonical.com>","References":"<20200725122442.1679820-1-vicamo.yang@canonical.com>","MIME-Version":"1.0","X-Mailman-Approved-At":"Sat, 25 Jul 2020 15:03:26 +0200","Subject":"[libcamera-devel] [PATCH 1/3] libcamera: process: fix killing\n\tinnocent processes unexpectedly","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>","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":"When a libcamera::process is being destructed or called kill() without a\nprevious successful call to start(), it's pid_ may remains -1, which\ncauses all the killable processes being killed when passed to\n`kill(pid_, SIG_KILL)`.\n\nSigned-off-by: You-Sheng Yang <vicamo.yang@canonical.com>\n---\n src/libcamera/process.cpp | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp\nindex e816ee8..8311d27 100644\n--- a/src/libcamera/process.cpp\n+++ b/src/libcamera/process.cpp\n@@ -373,7 +373,8 @@ void Process::died(int wstatus)\n  */\n void Process::kill()\n {\n-\t::kill(pid_, SIGKILL);\n+\tif (pid_ > 0)\n+\t\t::kill(pid_, SIGKILL);\n }\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","1/3"]}