GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-130163: Fix usage of borrow references from _PySys_GetAttr by sergey-miryanov · Pull Request #130282 · python/cpython Conversation
|
| Repro | Tests | Raised exception | |
|---|---|---|---|
_pickle.c/whichmodule |
No | No | Don't keep |
_threadmodule.c/thread_excepthook |
No | No | Keep |
faulthandler.c/faulthandler_get_fileno |
Yes | Yes | Don't keep |
bltinmodule.c/builtin_print_impl |
Yes | Yes | Don't keep |
bltinmodule.c/builtin_input_impl |
Yes | Yes | Don't keep |
errors.c/write_unraisable_exc |
No | No | Keep |
errors.c/format_unraisable_v |
Yes | Yes | Keep |
_warnings.c/show_warning |
Yes | Yes | Don't keep |
intrinsics.c/print_expr |
No | No | Don't keep |
pylifecycle.c/flush_std_files |
Yes/No | Yes/No | Don't keep |
pythonrun.c/_PyRun_InteractiveLoopObject |
No | No | Don't keep |
pythonrun.c/pyrun_one_parse_ast |
No | No | Don't keep |
pythonrun.c/_Py_HandleSystemExitAndKeyboardInterrupt |
No | No | Don't keep |
pythonrun.c/_PyErr_PrintEx |
Yes | Yes | Don't keep |
pythonrun.c/PyErr_Display |
No | No | Don't keep |
pythonrun.c/flush_io_stream |
No | No | Don't keep |
sysmodule.c/sys_displayhook |
Maybe | No | Don't keep |
sysmodule.c/get_warnoptions |
No | No | Don't keep |
sysmodule.c/PySys_ResetWarnOptions |
No | No | Don't keep |
sysmodule.c/PySys_HasWarnOptions |
No | No | Don't keep |
sysmodule.c/_PySys_AddXOptionWithError |
No | No | Don't keep |
sysmodule.c/PySys_SetArgvEx |
No | No | Don't keep |
sysmodule.c/sys_write |
No | No | Don't keep |
sysmodule.c/sys_format |
No | No | Don't keep |
traceback.c/_Py_FindSourceFile |
No | No | Don't keep |
sys_displayhook, but not where it's used.sys_write, sys_format - I have checked all the places where they called, and most of the locations are safe. However, a few places use %s specifier, in such places it is very tricky to get segfault.get_warnoptions, PySys_ResetWarnOptions, _PySys_AddXOptionWithError - are deprecated, but it is a very tricky to get segfault too.flush_io_stream, PyErr_Display, pyrun_one_parse_ast, print_expr, write_unraisable_exc, thread_excepthook - very tight - They use a borrowed reference right after getting. It might be possible to reproduce it under heavy contention, but I wasn't able to do so._PyRun_InteractiveLoopObject only checks presence of ps1 and ps2.flush_std_files used from _Py_Finalize and from fatal_error. For _Py_Finalize I can repro, for fatal_error - no.whichmodule, _Py_FindSourceFile iterate borrowed reference, but I wasn't able to reproduce segfault._PySys_GetAttr called without an exception set.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- also add checks of exit code
|
Close in favor #130503 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.