Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-130163: Fix usage of borrow references from _PySys_GetAttr#130282

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

sergey-miryanov
Copy link
Contributor

@sergey-miryanovsergey-miryanov commentedFeb 18, 2025
edited
Loading

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 usesys_displayhook, but not where it's used.
  • Forsys_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 getsegfault.
  • get_warnoptions,PySys_ResetWarnOptions,_PySys_AddXOptionWithError - are deprecated, but it is a very tricky to getsegfault 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 ofps1 andps2.
  • flush_std_files used from_Py_Finalize and fromfatal_error. For_Py_Finalize I can repro, forfatal_error - no.
  • whichmodule,_Py_FindSourceFile iterate borrowed reference, but I wasn't able to reproducesegfault.
  • 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
Reviewers
No reviews
Assignees
No one assigned
Labels
testsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@sergey-miryanov

[8]ページ先頭

©2009-2025 Movatter.jp