-
Notifications
You must be signed in to change notification settings - Fork 3
Description
While testing, I've run into occasional situations where the RP2350 freezes after running some OpenCV function. I eventually poked around with a debugger, and it turns out that calling Math.addref()
can sometimes freeze for an unknown reason.
Math.addref()
calls CV_XADD(&u->refcount, 1)
, which in turn calls the platform's atomic add function (CV_XADD
macro magic here). I'm not sure what that actually is for the RP2350, nor why it would cause a freeze.
There are underlying OpenCV calls to both Math.addref()
and CV_XADD(&u->refcount, 1)
, so can't necessarily do anything here. But might be able to define a special CV_XADD
that just increments without an atomic operation. Should be safe because of the Python GIL, right?
Will follow up with replication code if I can find something that easily replicates the problem.