You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I'm not sure what the implications of conflating !seq and len(seq) <=0 might be. I would guess that !seq does not requre a Py_DECREF but that a valid seq that fails len(seq) <= 0 might. (Since a zero length list isn't going to use gobs of memory it might be difficult to invoke this even with synthetic tests)
Along the same thread, I think there is a Py_DECREF missing from here:
I think this library still has a few gotchas remaining and I'm only barely qualified to find them. I've raised this issue for help digging them up.
For the first example; Running the following script shows at least one case where memory is leaked during exception handling:
This gives the following output:
In theory this has now created over 170,000 copies of our 4097 element list due to a missing
Py_DECREF(seq)
here:py-spidev/spidev_module.c
Lines 487 to 491 in 3239755
There may also be one missing here:
py-spidev/spidev_module.c
Lines 482 to 485 in 3239755
But I'm not sure what the implications of conflating
!seq
andlen(seq) <=0
might be. I would guess that!seq
does not requre aPy_DECREF
but that a validseq
that failslen(seq) <= 0
might. (Since a zero length list isn't going to use gobs of memory it might be difficult to invoke this even with synthetic tests)Along the same thread, I think there is a
Py_DECREF
missing from here:py-spidev/spidev_module.c
Lines 509 to 515 in 3239755
This can be encouraged to fail with the following script:
which gives the output:
I think anywhere there's a
return NULL
there's potentially a missingPy_DECREF(seq)
The text was updated successfully, but these errors were encountered: