从Debian Stretch升级到Bullseye后(例如Python 3.5→3.9(我们得到了以下uWSGI segfault:
uWSGI process 314459 got Segmentation Fault !!!
*** backtrace of 314459 ***
/usr/bin/uwsgi(uwsgi_backtrace+0x2f) [0x558ed0a9b96f]
/usr/bin/uwsgi(uwsgi_segfault+0x23) [0x558ed0a9bd73]
/lib/x86_64-linux-gnu/libc.so.6(+0x3bd60) [0x7fd71a9e0d60]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyErr_Occurred+0xe) [0x7fd7184d247e]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(+0x12d655) [0x7fd718586655]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(_PyType_Lookup+0x2d) [0x7fd71858678d]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(_PyObject_GenericGetAttrWithDict+0x4d) [0x7fd71856a73d]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(+0x1121c9) [0x7fd71856b1c9]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyObject_GetAttrString+0x3b) [0x7fd71856730b]
/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0(PyObject_HasAttrString+0x7) [0x7fd718567d87]
/usr/lib/uwsgi/plugins/python3_plugin.so(uwsgi_python_autoreloader_thread+0x179) [0x7fd718a04d19]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7) [0x7fd71b2d3ea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7fd71aaa2def]
*** end of backtrace ***
我们如何找出造成这种情况的原因以及如何解决问题?
禁用psycopg2
SSL模式没有帮助。
回溯中的这一行让我认为问题可能与自动重新加载有关:
/usr/lib/uwsgi/plugins/python3_plugin.so(uwsgi_python_autoreloader_thread+0x179) [0x7fd718a04d19]
然后我发现了这个问题:https://github.com/unbit/uwsgi/issues/1968
作为一种解决方法,我禁用了autoreload并恢复了服务。根据本页面,自动阅读仅用于开发目的。