Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--enable-pystats build fails on main #127518

Closed
mdboom opened this issue Dec 2, 2024 · 0 comments
Closed

--enable-pystats build fails on main #127518

mdboom opened this issue Dec 2, 2024 · 0 comments
Assignees
Labels
build The build process and cross-build performance Performance or resource usage type-bug An unexpected behavior, bug, or error

Comments

@mdboom
Copy link
Contributor

mdboom commented Dec 2, 2024

Bug report

Bug description:

Python/specialize.c: In function ‘store_subscr_fail_kind’:
Python/specialize.c:1821:50: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘tp_as_mapping’
 1821 |     PyMappingMethods *as_mapping = container_type->tp_as_mapping;
      |                                                  ^~
Python/specialize.c:1826:30: error: ‘container’ undeclared (first use in this function)
 1826 |     if (PyObject_CheckBuffer(container)) {
      |                              ^~~~~~~~~
Python/specialize.c:1826:30: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./Include/Python.h:63,
                 from Python/specialize.c:1:
Python/specialize.c:1827:31: error: ‘sub’ undeclared (first use in this function); did you mean ‘Sub’?
 1827 |         if (PyLong_CheckExact(sub) && (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub))) {
      |                               ^~~
./Include/pyport.h:37:38: note: in definition of macro ‘_Py_CAST’
   37 | #define _Py_CAST(type, expr) ((type)(expr))
      |                                      ^~~~
./Include/object.h:284:43: note: in expansion of macro ‘_PyObject_CAST’
  284 | #  define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), (type))
      |                                           ^~~~~~~~~~~~~~
./Include/longobject.h:14:31: note: in expansion of macro ‘Py_IS_TYPE’
   14 | #define PyLong_CheckExact(op) Py_IS_TYPE((op), &PyLong_Type)
      |                               ^~~~~~~~~~
Python/specialize.c:1827:13: note: in expansion of macro ‘PyLong_CheckExact’
 1827 |         if (PyLong_CheckExact(sub) && (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub))) {
      |             ^~~~~~~~~~~~~~~~~
Python/specialize.c:1830:39: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘tp_name’
 1830 |         else if (strcmp(container_type->tp_name, "array.array") == 0) {
      |                                       ^~
Python/specialize.c:1865:43: error: passing argument 1 of ‘_PyType_Lookup’ from incompatible pointer type [-Wincompatible-pointer-types]
 1865 |     PyObject *descriptor = _PyType_Lookup(container_type, &_Py_ID(__setitem__));
      |                                           ^~~~~~~~~~~~~~
      |                                           |
      |                                           PyObject * {aka struct _object *}
In file included from ./Include/object.h:754,
                 from ./Include/Python.h:72:
./Include/cpython/object.h:281:39: note: expected ‘PyTypeObject *’ {aka ‘struct _typeobject *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
  281 | PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
      |                                       ^~~~~~~~~~~~~~
Python/specialize.c: In function ‘_Py_Specialize_StoreSubscr’:
Python/specialize.c:1918:62: error: passing argument 1 of ‘store_subscr_fail_kind’ from incompatible pointer type [-Wincompatible-pointer-types]
 1918 |     SPECIALIZATION_FAIL(STORE_SUBSCR, store_subscr_fail_kind(container_type));
      |                                                              ^~~~~~~~~~~~~~
      |                                                              |
      |                                                              PyTypeObject * {aka struct _typeobject *}
Python/specialize.c:430:70: note: in definition of macro ‘SPECIALIZATION_FAIL’
  430 |         _Py_stats->opcode_stats[opcode].specialization.failure_kinds[kind]++; \
      |                                                                      ^~~~
Python/specialize.c:1819:34: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘PyTypeObject *’ {aka ‘struct _typeobject *’}
 1819 | store_subscr_fail_kind(PyObject *container_type)
      |                        ~~~~~~~~~~^~~~~~~~~~~~~~

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@mdboom mdboom added the type-bug An unexpected behavior, bug, or error label Dec 2, 2024
@mdboom mdboom self-assigned this Dec 2, 2024
@tomasr8 tomasr8 added the build The build process and cross-build label Dec 2, 2024
@mdboom mdboom added the performance Performance or resource usage label Dec 2, 2024
mdboom added a commit to mdboom/cpython that referenced this issue Dec 2, 2024
mdboom added a commit that referenced this issue Dec 2, 2024
@mdboom mdboom closed this as completed Dec 5, 2024
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build performance Performance or resource usage type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants