Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-21 Thread Eric Blake
From: Eric Blake To: Laszlo Ersek , d...@python.org Cc: Nir Soffer , arye...@google.com, libguestfs@redhat.com, shtark...@google.com Bcc: Subject: Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built Reply-To: In-Reply-To: [adding d...@python.org

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-21 Thread Laszlo Ersek
On 2/20/23 21:52, Eric Blake wrote: > On Mon, Feb 20, 2023 at 09:08:08PM +0200, Nir Soffer wrote: >> On Mon, Feb 20, 2023 at 10:45 AM Laszlo Ersek wrote: >>> >>> On 2/17/23 17:52, Eric Blake wrote: On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: >>> > - Py_BuildValue with

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-21 Thread Laszlo Ersek
On 2/20/23 20:08, Nir Soffer wrote: > On Mon, Feb 20, 2023 at 10:45 AM Laszlo Ersek wrote: >> >> On 2/17/23 17:52, Eric Blake wrote: >>> On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: >> - Py_BuildValue with the "O" format specifier transfers the new list's *sole*

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Eric Blake
On Mon, Feb 20, 2023 at 09:08:08PM +0200, Nir Soffer wrote: > On Mon, Feb 20, 2023 at 10:45 AM Laszlo Ersek wrote: > > > > On 2/17/23 17:52, Eric Blake wrote: > > > On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > > > > >> - Py_BuildValue with the "O" format specifier transfers the

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Nir Soffer
On Mon, Feb 20, 2023 at 10:45 AM Laszlo Ersek wrote: > > On 2/17/23 17:52, Eric Blake wrote: > > On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > > >> - Py_BuildValue with the "O" format specifier transfers the new list's > >> *sole* reference (= ownership) to the just-built

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Richard W.M. Jones
On Mon, Feb 20, 2023 at 09:45:33AM +0100, Laszlo Ersek wrote: > On 2/17/23 17:52, Eric Blake wrote: > > On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > > >> - Py_BuildValue with the "O" format specifier transfers the new list's > >> *sole* reference (= ownership) to the just-built

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Laszlo Ersek
On 2/17/23 17:52, Eric Blake wrote: > On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: >> - Py_BuildValue with the "O" format specifier transfers the new list's >> *sole* reference (= ownership) to the just-built higher-level object "args" > > Reference transfer is done with "N",

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-17 Thread Eric Blake
On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > On 2/14/23 19:51, Richard W.M. Jones wrote: > > In the case that building the parameters to the Python event callback > > fails, args was returned as NULL. We immediately tried to call > > Py_INCREF on this which crashed. Returning

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-16 Thread Richard W.M. Jones
On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > On 2/14/23 19:51, Richard W.M. Jones wrote: > > In the case that building the parameters to the Python event callback > > fails, args was returned as NULL. We immediately tried to call > > Py_INCREF on this which crashed. Returning

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-16 Thread Laszlo Ersek
On 2/14/23 19:51, Richard W.M. Jones wrote: > In the case that building the parameters to the Python event callback > fails, args was returned as NULL. We immediately tried to call > Py_INCREF on this which crashed. Returning NULL means the Python > function threw an exception, so print the