[{"id":30686,"web_url":"https://patchwork.libcamera.org/comment/30686/","msgid":"<20240807142455.GA18695@pendragon.ideasonboard.com>","date":"2024-08-07T14:24:55","subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Wed, Aug 07, 2024 at 02:49:50PM +0100, Kieran Bingham wrote:\n> The udev_monitor_receive_device() can return NULL on an error as\n> detailed in the man pages for the function.\n> \n> The udevNotify() handler in the DeviceEnumeratorUdev directly uses the\n> return value of udev_monitor_receive_device() in successive calls to\n> process the event without having first checked the udev_device.\n> \n> Ensure we identify, and handle events where the udev_device can not be\n> returned successfully.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=230\n> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> v2:\n>  - Report strerror based on errno from the udev_monitor_receive_device()\n>    call.\n> \n>  src/libcamera/device_enumerator_udev.cpp | 8 ++++++++\n>  1 file changed, 8 insertions(+)\n> \n> diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp\n> index 01c70b6daa82..53eeb772d900 100644\n> --- a/src/libcamera/device_enumerator_udev.cpp\n> +++ b/src/libcamera/device_enumerator_udev.cpp\n> @@ -332,6 +332,14 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum)\n>  void DeviceEnumeratorUdev::udevNotify()\n>  {\n>  \tstruct udev_device *dev = udev_monitor_receive_device(monitor_);\n> +\tif (!dev) {\n> +\t\tint error = errno;\n\ngrepping for ' = errno' gives me 12 variables named ret, and one named\nerr. I'd go for 'ret' here too for consitency.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nCould you ask the bug reporter to test this patch and tell what error\nnumber they get ?\n\n> +\t\tLOG(DeviceEnumerator, Warning)\n> +\t\t\t<< \"Ignoring notfication received without a device: \"\n> +\t\t\t<< strerror(error);\n> +\t\treturn;\n> +\t}\n> +\n>  \tstd::string_view action(udev_device_get_action(dev));\n>  \tstd::string_view deviceNode(udev_device_get_devnode(dev));\n>","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 CC03EBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Aug 2024 14:25:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F13B6338D;\n\tWed,  7 Aug 2024 16:25:20 +0200 (CEST)","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 A9E596337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Aug 2024 16:25:18 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 870DB2EC;\n\tWed,  7 Aug 2024 16:24:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"owpc20Dq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723040665;\n\tbh=bJYib1dE0CyQEJNQJTykc2QtzsBHj0hTfYCK17Sj7CA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=owpc20DqjrN2HFfWv9UduOPYk3LorxSEX2mXVIfbWHrP1trdDyjY174cqnOzrDNAs\n\tI4juvktFRbqnKGNbIvX0q2UVNQ0Nnm9P/3DkNwl40KjKeGE5cdk/VneiSN8bHwFjUs\n\tC5o+eQi3LfSvJgBEeG8KdhPKXwvnpOaRYPTE1mgw=","Date":"Wed, 7 Aug 2024 17:24:55 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","Message-ID":"<20240807142455.GA18695@pendragon.ideasonboard.com>","References":"<20240807134950.2458614-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240807134950.2458614-1-kieran.bingham@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30687,"web_url":"https://patchwork.libcamera.org/comment/30687/","msgid":"<172304120055.1687952.7218785674653397396@ping.linuxembedded.co.uk>","date":"2024-08-07T14:33:20","subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-08-07 15:24:55)\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Wed, Aug 07, 2024 at 02:49:50PM +0100, Kieran Bingham wrote:\n> > The udev_monitor_receive_device() can return NULL on an error as\n> > detailed in the man pages for the function.\n> > \n> > The udevNotify() handler in the DeviceEnumeratorUdev directly uses the\n> > return value of udev_monitor_receive_device() in successive calls to\n> > process the event without having first checked the udev_device.\n> > \n> > Ensure we identify, and handle events where the udev_device can not be\n> > returned successfully.\n> > \n> > Bug: https://bugs.libcamera.org/show_bug.cgi?id=230\n> > Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > ---\n> > v2:\n> >  - Report strerror based on errno from the udev_monitor_receive_device()\n> >    call.\n> > \n> >  src/libcamera/device_enumerator_udev.cpp | 8 ++++++++\n> >  1 file changed, 8 insertions(+)\n> > \n> > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp\n> > index 01c70b6daa82..53eeb772d900 100644\n> > --- a/src/libcamera/device_enumerator_udev.cpp\n> > +++ b/src/libcamera/device_enumerator_udev.cpp\n> > @@ -332,6 +332,14 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum)\n> >  void DeviceEnumeratorUdev::udevNotify()\n> >  {\n> >       struct udev_device *dev = udev_monitor_receive_device(monitor_);\n> > +     if (!dev) {\n> > +             int error = errno;\n> \n> grepping for ' = errno' gives me 12 variables named ret, and one named\n> err. I'd go for 'ret' here too for consitency.\n\nI explicitly didn't use 'ret' because it's not a ret value...\n\nAnd 'err' was just shorthand. I'll rename if you wish, but please\nconfirm.\n\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Could you ask the bug reporter to test this patch and tell what error\n> number they get ?\n\nYes, but I don't know how they'll test it, as it's part of a separate CI\nsystem, so I don't think we'll get a response (until it filters into a\nrelease, that then gets utilised in that CI system).\n\n--\nKieran\n\n\n\n> \n> > +             LOG(DeviceEnumerator, Warning)\n> > +                     << \"Ignoring notfication received without a device: \"\n> > +                     << strerror(error);\n> > +             return;\n> > +     }\n> > +\n> >       std::string_view action(udev_device_get_action(dev));\n> >       std::string_view deviceNode(udev_device_get_devnode(dev));\n> >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 3C1B9C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Aug 2024 14:33:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4763463393;\n\tWed,  7 Aug 2024 16:33:25 +0200 (CEST)","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 DCCC96337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Aug 2024 16:33:23 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E7CCF2EC;\n\tWed,  7 Aug 2024 16:32:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gwy4eyHv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723041151;\n\tbh=ti5SciXFPj++U6dbCvbY6pi9UqC9udjxhIaSJATiR+A=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=gwy4eyHv0Pb0Wru/PcKsx5tKiGPxogmLrvWWk97zopJVrhBdlN/2QQtzSWH3/tscV\n\tvy4aTbtNnJnYaJD12eGzD7b9iJzPC4G8YxamRNCsJyjQmeaTpAanxUGvYrMhk2qdWA\n\tdihkaslqEb9yh0ghbBKkAg2oR1iY/yu+jyEDEMuo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240807142455.GA18695@pendragon.ideasonboard.com>","References":"<20240807134950.2458614-1-kieran.bingham@ideasonboard.com>\n\t<20240807142455.GA18695@pendragon.ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Wed, 07 Aug 2024 15:33:20 +0100","Message-ID":"<172304120055.1687952.7218785674653397396@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30689,"web_url":"https://patchwork.libcamera.org/comment/30689/","msgid":"<20240807150159.GB18695@pendragon.ideasonboard.com>","date":"2024-08-07T15:01:59","subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Aug 07, 2024 at 03:33:20PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2024-08-07 15:24:55)\n> > On Wed, Aug 07, 2024 at 02:49:50PM +0100, Kieran Bingham wrote:\n> > > The udev_monitor_receive_device() can return NULL on an error as\n> > > detailed in the man pages for the function.\n> > > \n> > > The udevNotify() handler in the DeviceEnumeratorUdev directly uses the\n> > > return value of udev_monitor_receive_device() in successive calls to\n> > > process the event without having first checked the udev_device.\n> > > \n> > > Ensure we identify, and handle events where the udev_device can not be\n> > > returned successfully.\n> > > \n> > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=230\n> > > Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > \n> > > ---\n> > > v2:\n> > >  - Report strerror based on errno from the udev_monitor_receive_device()\n> > >    call.\n> > > \n> > >  src/libcamera/device_enumerator_udev.cpp | 8 ++++++++\n> > >  1 file changed, 8 insertions(+)\n> > > \n> > > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp\n> > > index 01c70b6daa82..53eeb772d900 100644\n> > > --- a/src/libcamera/device_enumerator_udev.cpp\n> > > +++ b/src/libcamera/device_enumerator_udev.cpp\n> > > @@ -332,6 +332,14 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum)\n> > >  void DeviceEnumeratorUdev::udevNotify()\n> > >  {\n> > >       struct udev_device *dev = udev_monitor_receive_device(monitor_);\n> > > +     if (!dev) {\n> > > +             int error = errno;\n> > \n> > grepping for ' = errno' gives me 12 variables named ret, and one named\n> > err. I'd go for 'ret' here too for consitency.\n> \n> I explicitly didn't use 'ret' because it's not a ret value...\n> \n> And 'err' was just shorthand. I'll rename if you wish, but please\n> confirm.\n\nI'd prefer 'ret' but I'm also fine with 'err'.\n\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> > Could you ask the bug reporter to test this patch and tell what error\n> > number they get ?\n> \n> Yes, but I don't know how they'll test it, as it's part of a separate CI\n> system, so I don't think we'll get a response (until it filters into a\n> release, that then gets utilised in that CI system).\n\nCan't they push a test branch to that CI system, or run the failing\ntests locally ?\n\n> > > +             LOG(DeviceEnumerator, Warning)\n> > > +                     << \"Ignoring notfication received without a device: \"\n> > > +                     << strerror(error);\n> > > +             return;\n> > > +     }\n> > > +\n> > >       std::string_view action(udev_device_get_action(dev));\n> > >       std::string_view deviceNode(udev_device_get_devnode(dev));\n> > >","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 DBDECC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Aug 2024 15:02:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE1BD6338D;\n\tWed,  7 Aug 2024 17:02:26 +0200 (CEST)","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 057266337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Aug 2024 17:02:25 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D2DA96AF;\n\tWed,  7 Aug 2024 17:01:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"sURImXtA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723042892;\n\tbh=fai+cCsohnDwUsKK+As4mWL6OVcnRHnslUBF2VqfxU0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sURImXtA3BCDZBTTSjG2lNndq0Rvc128WfY4+Fjh360QBJrNdBohTFi4je5/2eGLE\n\t9igLL6MOD+vrEFaWWU1/+5Q252H4ekFEFp+HrkRiNdM19grXnulfb70tBluaN9olyQ\n\tn7TecFKXs5+LA4fkzTBb1jUI5TkYpGzMdi6DRGC4=","Date":"Wed, 7 Aug 2024 18:01:59 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","Message-ID":"<20240807150159.GB18695@pendragon.ideasonboard.com>","References":"<20240807134950.2458614-1-kieran.bingham@ideasonboard.com>\n\t<20240807142455.GA18695@pendragon.ideasonboard.com>\n\t<172304120055.1687952.7218785674653397396@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<172304120055.1687952.7218785674653397396@ping.linuxembedded.co.uk>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30690,"web_url":"https://patchwork.libcamera.org/comment/30690/","msgid":"<172304473314.1687952.12255428320847391135@ping.linuxembedded.co.uk>","date":"2024-08-07T15:32:13","subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-08-07 16:01:59)\n> On Wed, Aug 07, 2024 at 03:33:20PM +0100, Kieran Bingham wrote:\n> > Quoting Laurent Pinchart (2024-08-07 15:24:55)\n> > > On Wed, Aug 07, 2024 at 02:49:50PM +0100, Kieran Bingham wrote:\n> > > > The udev_monitor_receive_device() can return NULL on an error as\n> > > > detailed in the man pages for the function.\n> > > > \n> > > > The udevNotify() handler in the DeviceEnumeratorUdev directly uses the\n> > > > return value of udev_monitor_receive_device() in successive calls to\n> > > > process the event without having first checked the udev_device.\n> > > > \n> > > > Ensure we identify, and handle events where the udev_device can not be\n> > > > returned successfully.\n> > > > \n> > > > Bug: https://bugs.libcamera.org/show_bug.cgi?id=230\n> > > > Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > > \n> > > > ---\n> > > > v2:\n> > > >  - Report strerror based on errno from the udev_monitor_receive_device()\n> > > >    call.\n> > > > \n> > > >  src/libcamera/device_enumerator_udev.cpp | 8 ++++++++\n> > > >  1 file changed, 8 insertions(+)\n> > > > \n> > > > diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp\n> > > > index 01c70b6daa82..53eeb772d900 100644\n> > > > --- a/src/libcamera/device_enumerator_udev.cpp\n> > > > +++ b/src/libcamera/device_enumerator_udev.cpp\n> > > > @@ -332,6 +332,14 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum)\n> > > >  void DeviceEnumeratorUdev::udevNotify()\n> > > >  {\n> > > >       struct udev_device *dev = udev_monitor_receive_device(monitor_);\n> > > > +     if (!dev) {\n> > > > +             int error = errno;\n> > > \n> > > grepping for ' = errno' gives me 12 variables named ret, and one named\n> > > err. I'd go for 'ret' here too for consitency.\n> > \n> > I explicitly didn't use 'ret' because it's not a ret value...\n> > \n> > And 'err' was just shorthand. I'll rename if you wish, but please\n> > confirm.\n> \n> I'd prefer 'ret' but I'm also fine with 'err'.\n> \n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > \n> > > Could you ask the bug reporter to test this patch and tell what error\n> > > number they get ?\n> > \n> > Yes, but I don't know how they'll test it, as it's part of a separate CI\n> > system, so I don't think we'll get a response (until it filters into a\n> > release, that then gets utilised in that CI system).\n> \n> Can't they push a test branch to that CI system, or run the failing\n> tests locally ?\n\nYou tell me ;-) But I would suspect that as they were testing \"something\nelse entirely\" [0] it would require updating various CI docker images to\nmake a different version of libcamera be built inside that test\ncontainer (which I would anticipate would have been a binary package\ninstallation) - so that they could run their secondary test which was\nprobably a race condition as 7 out of 8 other runs [1][2] on different\nrunners worked successfully.\n\nI've asked [3] - I'm just saying that I'm not expecting any 'quick'\nanswer. I think this is like asking them to test a systemd patch in our\nlibcamera CI...\n\n[0] Update syscall tables and linux headers #33930 (systemd)\n    https://github.com/systemd/systemd/pull/33930\n\n[1] https://github.com/systemd/systemd/actions/runs/10233929013\n[2] https://github.com/systemd/systemd/actions/runs/10233929013/job/28312766461\n\n[3] https://github.com/systemd/systemd/pull/33930#issuecomment-2273739561\n\n--\nKieran\n\n\n> \n> > > > +             LOG(DeviceEnumerator, Warning)\n> > > > +                     << \"Ignoring notfication received without a device: \"\n> > > > +                     << strerror(error);\n> > > > +             return;\n> > > > +     }\n> > > > +\n> > > >       std::string_view action(udev_device_get_action(dev));\n> > > >       std::string_view deviceNode(udev_device_get_devnode(dev));\n> > > >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 E936EBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Aug 2024 15:32:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 112896337F;\n\tWed,  7 Aug 2024 17:32:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B31116337E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Aug 2024 17:32:15 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B63E2D4A;\n\tWed,  7 Aug 2024 17:31:22 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MM/FcvGy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1723044682;\n\tbh=lVeoRERCviy5LEPVsLuwk1L0BBREuDk1i+9mpSPWCqo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=MM/FcvGyOuw+Inmu5lPniKQnEm1gJri9wap3krSFiH9xhHEeOTRrxGmOyq27AuEV1\n\tmPQm8I4qJhDSlq6CjFp1wwLX9hh+r1GcKILdyeUpL7C6lJZ/H9csYl5YHd+5hkfXq8\n\txxLQ5+ROiKVIvY3REQ/8xxZ59QgJJLZPZN0zkaJY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240807150159.GB18695@pendragon.ideasonboard.com>","References":"<20240807134950.2458614-1-kieran.bingham@ideasonboard.com>\n\t<20240807142455.GA18695@pendragon.ideasonboard.com>\n\t<172304120055.1687952.7218785674653397396@ping.linuxembedded.co.uk>\n\t<20240807150159.GB18695@pendragon.ideasonboard.com>","Subject":"Re: [PATCH v2] libcamera: udev: Catch udev notification errors","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Wed, 07 Aug 2024 16:32:13 +0100","Message-ID":"<172304473314.1687952.12255428320847391135@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]