GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `intern_static()` never detects a failed `_Py_hashtable_set()` (`< -1` should be `< 0`) · Issue #157892 · python/cpython

intern_static() never detects a failed _Py_hashtable_set() (< -1 should be < 0) #157892

New issue
Copy link
New issue
Copy link
Closed
Closed
intern_static() never detects a failed _Py_hashtable_set() (< -1 should be < 0)#157892
Copy link
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@eendebakpt
eendebakpt
opened on Sep 21, 2026
Issue body actions

Bug report

Bug description:

In intern_static() in Objects/unicodeobject.c, the result of _Py_hashtable_set() is compared with < -1:

cpython/Objects/unicodeobject.c

Line 14591 in 21223c9

if (_Py_hashtable_set(INTERNED_STRINGS, s, s) < -1) {
)

_Py_hashtable_set() (Python/hashtable.c) returns 0 on success and -1 when the entry allocation fails, so this condition is never true and the Py_FatalError() call is unreachable.

The check has been like this since gh-120520, so 3.13, 3.14 and main are affected.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • gh-157892: Fix error check on _Py_hashtable_set() in intern_static() #157898
  • [3.13] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) #158299
  • [3.14] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) #158300
  • [3.15] gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (GH-157898) #158301

Activity

  1. eendebakpt
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    easy
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Sep 21, 2026
  2. Vara715 commented on Sep 27, 2026

    @Vara715
    Vara715
    on Sep 27, 2026
    More actions

    hey, can i work on this one?

  3. pochmann commented on Sep 27, 2026

    @pochmann
    pochmann
    on Sep 27, 2026
    Contributor
    More actions

    @Vara715 Why? What's wrong with the already existing PR? What would you do differently?

  4. eendebakpt
    added a commit that references this issue on Sep 27, 2026

    gh-157892: Fix error check on _Py_hashtable_set() in intern_static() (#…

    a4eb936
  5. Yhg1s
    added a commit that references this issue on Sep 29, 2026

    [3.13] gh-157892: Fix error check on _Py_hashtable_set() in intern_st…

    036d2d6
  6. eendebakpt
    added a commit that references this issue on Sep 29, 2026

    [3.14] gh-157892: Fix error check on _Py_hashtable_set() in intern_st…

    72c85c6
  7. serhiy-storchaka
    added a commit that references this issue on Oct 10, 2026

    [3.15] gh-157892: Fix error check on _Py_hashtable_set() in intern_st…

    7c328b6
  8. hugovk
    closed this as completedon Oct 11, 2026
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

    easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.