Skip to content

Conversation

@sergey-miryanov
Copy link
Contributor

@sergey-miryanovsergey-miryanov commented Feb 18, 2025

WIP

ReproTestsRaised exception
_pickle.c/whichmoduleNoNoDon't keep
_threadmodule.c/thread_excepthookNoNoKeep
faulthandler.c/faulthandler_get_filenoYesYesDon't keep
bltinmodule.c/builtin_print_implYesYesDon't keep
bltinmodule.c/builtin_input_implYesYesDon't keep
errors.c/write_unraisable_excNoNoKeep
errors.c/format_unraisable_vYesYesKeep
_warnings.c/show_warningYesYesDon't keep
intrinsics.c/print_exprNoNoDon't keep
pylifecycle.c/flush_std_filesYes/NoYes/NoDon't keep
pythonrun.c/_PyRun_InteractiveLoopObjectNoNoDon't keep
pythonrun.c/pyrun_one_parse_astNoNoDon't keep
pythonrun.c/_Py_HandleSystemExitAndKeyboardInterruptNoNoDon't keep
pythonrun.c/_PyErr_PrintExYesYesDon't keep
pythonrun.c/PyErr_DisplayNoNoDon't keep
pythonrun.c/flush_io_streamNoNoDon't keep
sysmodule.c/sys_displayhookMaybeNoDon't keep
sysmodule.c/get_warnoptionsNoNoDon't keep
sysmodule.c/PySys_ResetWarnOptionsNoNoDon't keep
sysmodule.c/PySys_HasWarnOptionsNoNoDon't keep
sysmodule.c/_PySys_AddXOptionWithErrorNoNoDon't keep
sysmodule.c/PySys_SetArgvExNoNoDon't keep
sysmodule.c/sys_writeNoNoDon't keep
sysmodule.c/sys_formatNoNoDon't keep
traceback.c/_Py_FindSourceFileNoNoDon't keep
  • I can get a "segfault" error when I use sys_displayhook, but not where it's used.
  • For 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.
  • Keep or not before raised exception - in the most places _PySys_GetAttr called without an exception set.

@sergey-miryanov
Copy link
ContributorAuthor

Close in favor #130503

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@sergey-miryanov