-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current git HEAD tests fail on FreeBSD 14 / Python 3.11.9: test_python_factory_invalid_callable_value #1413
Comments
Hmm, I have a vague recollection of hitting this before and it was something particular to this version of Python... |
Bears further investigation, but if we're only seeing it on that specific FreeBSD / Python version combination, not a release blocker. |
I believe it's a bug in that version of Python. |
Can we verify that by getting the tests to pass on any newer version of FreeBSD + Python? |
It's currently the latest version of Python that is available on FreeBSD. The test does succeed with 3.10 which is also available:
|
Yeah, I wouldn't worry about it. That failing test is for the new Python Application Factory thing, and in this case we are deliberately doing something wrong. |
On some Python 3.11 systems, 3.11.9 & 3.11.10, we were seeing a crash triggered by Py_Finalize() in nxt_python_start() when running one of our pytests, namely test/test_python_factory.py::test_python_factory_invalid_callable_value 2024/09/12 15:07:29 [alert] 5452#5452 factory "wsgi_invalid_callable" in module "wsgi" can not be called to fetch callable Fatal Python error: none_dealloc: deallocating None: bug likely caused by a refcount error in a C extension Python runtime state: finalizing (tstate=0x00007f560b88a718) Current thread 0x00007f560bde7ad0 (most recent call first): <no Python frame> 2024/09/12 15:07:29 [alert] 5451#5451 app process 5452 exited on signal 6 (core dumped) It seems this was caused by Py_XDECREF(nxt_py_stderr_flush); in nxt_python_atexit(). We never explicitly INCREF() this variable (though there are plenty of other cases of doing DECREF()'s with no previous INCREF()'s). However in this case adding an INCREF() for this variable does fix the crash. I'm not sure we really need to reference count this variable, it's only used in nxt_python_print_exception(), but it's perhaps the safest course of action. Cc: Konstantin Pavlov <[email protected]> Closes: nginx#1413 Signed-off-by: Andrew Clayton <[email protected]>
You could try this patch from #1420 diff --git ./src/python/nxt_python.c ./src/python/nxt_python.c
index 7bbf3d49..a1d4444c 100644
--- ./src/python/nxt_python.c
+++ ./src/python/nxt_python.c
@@ -258,6 +258,8 @@ nxt_python_start(nxt_task_t *task, nxt_process_data_t *data)
goto fail;
}
+ Py_INCREF(nxt_py_stderr_flush);
+
if (nxt_slow_path(nxt_python_set_path(task, c->path) != NXT_OK)) {
goto fail;
} |
When built with
./configure && ./configure python --config=python3-config && make
, Unit currently fails the test on FreeBSD 14, with Python 3.11.9. No other tests fail.The text was updated successfully, but these errors were encountered: