[spam] [archive] [hacking] Working on finalising a mobile python driver.

Karl gmkarl at gmail.com
Thu Jan 14 02:32:26 PST 2021


It's hard for me to do stuff, so when I really do something I hunker
down and ignore everything else.  Somewhat described elsewhere
on-list.

Right now I'm running into a frustrating issue.  I've encountered
similar issues before, in other languages, but this is the first one
I've really butted heads with in Python.

My python codebase currently crashes.  One of parts may relate to
object lifetime between android's java garbage collector and python's
garbage collector.  A strange behavior is that my python object is
getting multiply constructed.

I use the python object in a loop.  It's constructed before the start
of the loop, and then repeatedly called inside the loop, inside a try
handler inside which an exception is thrown.  I've done a textual
search on the code and believe prior to that loop to be the only place
the constructor is called.  However, when I put a debugging line
inside the constructor, the line is output every iteration of the
loop.

This particular python object is not intertwined with java, but inside
the loop it produces a python object that is linked to java via the
jni and cpython, and adds it as a member.

I have output the traceback inside the constructor, and the traceback
is empty.  The only line is the constructor itself, as if a thread was
started with the constructor as the thread functions.

[*relief] It looks like even on the first call, the traceback has only
one line.  Maybe this is because it uses python's async feature.  But
constructers never use the async feature, so this must be a bug in the
traceback.


More information about the cypherpunks mailing list