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
cpython.c makes quite liberal use of METH_NOARGS, which causes the PyCFunction pointer to be invoked as (*meth)(self, NULL), however most of our METH_NOARGS functions are delcared as PyObject *func(PyObject *self), i.e. lacking the second parameter.
In calling conventions where the caller is responsible for stack cleanup (such as on Linux) this won't break, however on Windows, where the callee is responsible for cleaning up the stack, there is potential for the stack to become inconsistent for each call to any of our METH_NOARGS functions.
This doesn't seem to have ever generated a bug report - and I'm not even sure what such a bug report would look like, however the problem is real.
The simple solution is to add a second dummy PyObject parameter to every METH_NOARGS function, and double-check the rest of our signatures to see if a similar problem exists elsewhere.
I'm happy to take this ticket when I have a free moment :)
The text was updated successfully, but these errors were encountered:
Affected Operating Systems
Affected py-lmdb Version
master
Describe Your Problem
cpython.c
makes quite liberal use ofMETH_NOARGS
, which causes thePyCFunction
pointer to be invoked as(*meth)(self, NULL)
, however most of ourMETH_NOARGS
functions are delcared asPyObject *func(PyObject *self)
, i.e. lacking the second parameter.In calling conventions where the caller is responsible for stack cleanup (such as on Linux) this won't break, however on Windows, where the callee is responsible for cleaning up the stack, there is potential for the stack to become inconsistent for each call to any of our
METH_NOARGS
functions.This doesn't seem to have ever generated a bug report - and I'm not even sure what such a bug report would look like, however the problem is real.
The simple solution is to add a second dummy PyObject parameter to every
METH_NOARGS
function, and double-check the rest of our signatures to see if a similar problem exists elsewhere.I'm happy to take this ticket when I have a free moment :)
The text was updated successfully, but these errors were encountered: