| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| def call(self, callable, /, *args, **kwargs): | ||
| """Call the object in the interpreter with given args/kwargs. | ||
|
|
||
| Only functions that take no arguments and have no closure |
There was a problem hiding this comment.
The docstring looks partially outdated (here or in Lib/interpreters/__init__.py). The same would apply for _interpretersmodule.c?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
There was a problem hiding this comment.
This review focuses on the refleaks in test_api (Py_GIL_DISABLED seems to skip the test).
_PyFunction_VerifyStateless:
Line 1267 in 0d499c7
Sorry, something went wrong.
| struct interp_call temp = *call; | ||
| *call = (struct interp_call){0}; | ||
| if (temp.func != NULL) { | ||
| _PyXIData_Clear(NULL, temp.func); |
There was a problem hiding this comment.
_PyXIData_Clear() here does not work expectedly on MSVC.
struct interp_call temp = *call;
printf("before: %p %p %p\n", temp.func, temp.func->data, temp.func->obj);
*call = (struct interp_call){0};
printf("after : %p %p %p\n", temp.func, temp.func->data, temp.func->obj);
before: 0000000000C3CF58 00000000057763B0 0000000002BFCEF0
after : 0000000000C3CF58 0000000000000000 0000000000000000
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, the logic here is wrong because the pointers in temp point to the call fields, which have been nulled out. I'm fixing that.
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
| PyObject *exc = _PyErr_GetRaisedException(tstate); | ||
| if (_PyPickle_GetXIData(tstate, func, &call->_preallocated.func) < 0) { | ||
| _PyErr_SetRaisedException(tstate, exc); | ||
| //unwrap_not_shareable(tstate); | ||
| return -1; | ||
| } |
There was a problem hiding this comment.
Py_DECREF(exc) seems missing after L472.
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
| } | ||
|
|
||
| _PyXI_FreeSession(session); | ||
| return res; |
There was a problem hiding this comment.
Py_CLEAR(result.preserved) before L665 seems effective?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
| PyObject *func, *args, *kwargs; | ||
| if (_interp_call_unpack(call, &func, &args, &kwargs) == 0) { | ||
| // Either the problem is intermittent or only affects subinterpreters. | ||
| // This is highly unlikely. |
There was a problem hiding this comment.
Py_DECREF(func); Py_DECREF(args); Py_XDECREF(kwargs);?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
| if (kwargs_obj != NULL) { | ||
| _PyErr_SetString(tstate, PyExc_ValueError, "got unexpected kwargs"); | ||
| struct interp_call call = {0}; | ||
| if (_interp_call_pack(tstate, &call, callable, args_obj, kwargs_obj) < 0) { |
There was a problem hiding this comment.
_interp_call_clear(&call) in the branch?
Sorry, something went wrong.
There was a problem hiding this comment.
fixed
Sorry, something went wrong.
Nice catch. I also got it wrong with defaults because it's supposed to be a tuple, not a dict. |
Sorry, something went wrong.
|
!buildbot AMD64 Fedora Stable Refleaks |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 17beeda 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133484%2Fmerge The command will test the builders whose names match following regular expression: AMD64 Fedora Stable Refleaks The builders matched are:
|
Sorry, something went wrong.
|
@neonene, thanks again for all the help chasing down leaks! You saved me a bunch of time. |
Sorry, something went wrong.
|
Unless there are any objections, I'll merge this first thing in the morning (~16:00 UTC). |
Sorry, something went wrong.
|
Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
|
GH-134933 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…h-133484) It now supports most callables, full args, and return values.
…h-133484) It now supports most callables, full args, and return values.
…h-133484) It now supports most callables, full args, and return values.
| Back | FazBrowse Home | New Git URL |
It now supports most callables, full args, and return values.