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 — The C analyzer seems to fail when `--disable-gil` is set · Issue #136952 · python/cpython

The C analyzer seems to fail when --disable-gil is set #136952

New issue
Copy link
New issue
Copy link
Open
#156969
Open
The C analyzer seems to fail when --disable-gil is set#136952
#156969
Copy link
Labels
topic-free-threadingtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@ZeroIntensity
ZeroIntensity
opened on Jul 21, 2025
Issue body actions

Bug report

Bug description:

When running the C analyzer's check-c-globals script locally, I noticed this failure on gc_free_threading.c:

$ python3.13 Tools/c-analyzer/check-c-globals.py Python/gc_free_threading.c
analyzing files...
.# requested file: </home/peter/develop/cpython/Python/gc_free_threading.c>

-------------------------

Non-constant global variables are generally not supported
in the CPython repo.  We use a tool to analyze the C code
and report if any unsupported globals are found.  The tool
may be run manually with:

  ./python Tools/c-analyzer/check-c-globals.py --format summary [FILE]

Occasionally the tool is unable to parse updated code.
If this happens then add the file to the "EXCLUDED" list
in Tools/c-analyzer/cpython/_parser.py and create a new
issue for fixing the tool (and CC ericsnowcurrently
on the issue).

If the tool reports an unsupported global variable and
it is actually const (and thus supported) then first try
fixing the declaration appropriately in the code.  If that
doesn't work then add the variable to the "should be const"
section of Tools/c-analyzer/cpython/ignored.tsv.

If the tool otherwise reports an unsupported global variable
then first try to make it non-global, possibly adding to
PyInterpreterState (for core code) or module state (for
extension modules).  In an emergency, you can add the
variable to Tools/c-analyzer/cpython/globals-to-fix.tsv
to get CI passing, but doing so should be avoided.  If
this course it taken, be sure to create an issue for
eliminating the global (and CC ericsnowcurrently).

ERROR: unmatched text (/home/peter/develop/cpython/Python/gc_free_threading.c starting at line 524):
extern int (*__Static_assert_function (void)) [!!sizeof ( struct inline-1 )] ; extern int (*__Static_assert_function (void)) [!!sizeof (struct { int __error_if_negative: ( 16 < 256 && 8 < 16 && 8 > 0 ) ? 2 : -1; })] ; typedef struct { PyObject **start; PyObject **end; } gc_span_t; typedef struct { Py_ssize_t size; Py_ssize_t capacity; gc_span_t *stack; } gc_span_stack_t; typedef struct { unsigned int in; unsigned int out; _PyObjectStack stack; gc_span_stack_t spans; PyObject *buffer[256]; _Bool ...

This only comes up when ./configure --disable-gil is used beforehand (which is a little odd, considering a release build of Python is being used, not the local compiled version), so it doesn't show up in CI.

cc @ericsnowcurrently

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Linux

Linked PRs

  • gh-136952: Fix C analyzer handling of static assertions #156969

Activity

  1. ZeroIntensity
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.14bugs and security fixesbugs and security fixes
    3.15bugs and security fixesbugs and security fixes
    topic-free-threading
    on Jul 21, 2025
  2. MengAiDev commented on Jul 22, 2025

    @MengAiDev
    MengAiDev
    on Jul 22, 2025
    More actions

    I also met the problem when --disable-gil: #136957

  3. sergey-miryanov commented on Jul 22, 2025

    @sergey-miryanov
    sergey-miryanov
    on Jul 22, 2025
    Contributor
    More actions

    @ZeroIntensity JFYI this is my PR #133159 were I fixed how error messages for unmatched text printed to be clearer and more informative.

  4. ShellWen
    added 3 commits that reference this issue on Sep 5, 2026

    pythongh-136952: Handle analyzer alignment and GCC test portability

    b0b0ae5

    pythongh-136952: Fix C analyzer handling of static assertions

    f1a6659

    pythongh-136952: Handle analyzer alignment and GCC test portability

    8110334
  5. picnixz
    added
    triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.
    and removed
    3.14bugs and security fixesbugs and security fixes
    3.15bugs and security fixesbugs and security fixes
    on Sep 6, 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

    topic-free-threadingtriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.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.