Skip to content

_PyModule_IsPossiblyShadowing can return -1 without an exception set #130932

Closed

Description

@colesbury

Bug report

Bug description:

This can lead to an assertion failure:

#6  0x00007ffff7ca9e96 in __GI___assert_fail (assertion=0x555555a5e2da "PyErr_Occurred()", file=0x555555a6edcd "Objects/object.c", line=1253, function=0x555555a6f36e "int _PyObject_SetAttributeErrorContext(PyObject *, PyObject *)") at ./assert/assert.c:101
#7  0x00005555557273ac in _PyObject_SetAttributeErrorContext (v=<module at remote 0x200009a1a50>, name='getaliases') at Objects/object.c:1253
#8  0x0000555555726dde in PyObject_GetAttr (v=<module at remote 0x200009a1a50>, name='getaliases') at Objects/object.c:1306
#9  0x0000555555727de6 in _PyObject_GetMethod (obj=<module at remote 0x200009a1a50>, name='getaliases', method=0x7ffffffdb1b8) at Objects/object.c:1581
#10 0x000055555588456d in _PyEval_EvalFrameDefault (tstate=0x555555d16fb0 <_PyRuntime+360560>, frame=0x7ffff7f9cf20, throwflag=0) at Python/generated_cases.c.h:7682

_Py_wgetcwd does not set an exception on failure:

if (!_Py_wgetcwd(sys_path_0_buf, MAXPATHLEN)) {
return -1;

Likely related to #95754

cc @hauntsaninja

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. hauntsaninja commented on Mar 6, 2025

    @hauntsaninja
    Contributor

    Thanks for spotting! Will put a PR...

  2. added 2 commits that reference this issue on Mar 6, 2025
  3. added a commit that references this issue on Mar 7, 2025
  4. added a commit that references this issue on Mar 7, 2025
  5. added a commit that references this issue on Mar 7, 2025
  6. added a commit that references this issue on Mar 10, 2025
  7. added a commit that references this issue on Mar 11, 2025
  8. added a commit that references this issue on Mar 11, 2025
  9. added a commit that references this issue on Mar 11, 2025
  10. added
    3.13only security fixes
    3.14bugs and security fixes
    on Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions