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 — test_ctypes: test_generated_data() fails on x86 Debian Installed with X 3.x · Issue #121938 · python/cpython

test_ctypes: test_generated_data() fails on x86 Debian Installed with X 3.x #121938

New issue
Copy link
New issue
Copy link
Closed
Closed
test_ctypes: test_generated_data() fails on x86 Debian Installed with X 3.x#121938
Copy link
Assignees
encukou
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-ctypestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Jul 17, 2024
Issue body actions

Bug report

x86 Debian Installed with X 3.x build: https://buildbot.python.org/all/#/builders/1244/builds/2499

FAIL: test_generated_data (test.test_ctypes.test_generated_structs.GeneratedTest.test_generated_data) (name='Packed4')
Check that a ctypes struct/union matches its C equivalent.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-debian-x86.installed/build/target/lib/python3.14/test/test_ctypes/test_generated_structs.py", line 444, in test_generated_data
    self.assertEqual(sizeof(cls), next(expected))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 12 != 16

The structure:

@register()
class Packed4(Structure):
    _fields_ = [('a', c_int8), ('b', c_int64)]
    _pack_ = 8

configure:

./configure --prefix '$(PWD)/target'

test.pythoninfo:

CC.version: gcc (Debian 12.2.0-14) 12.2.0

sysconfig[CFLAGS]: -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall

sysconfig[PY_CFLAGS]: -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall

sysconfig[PY_CFLAGS_NODIST]: -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc

sysconfig[PY_STDMODULE_CFLAGS]: -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include

Linked PRs

  • gh-121938: ctypes: Skip test of _pack_-ed struct with c_int64 on x86 #125877

Activity

  1. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Jul 17, 2024
  2. vstinner commented on Aug 5, 2024

    @vstinner
    vstinner
    on Aug 5, 2024
    MemberAuthor
    More actions

    cc @zware

  3. zware commented on Aug 5, 2024

    @zware
    zware
    on Aug 5, 2024
    Member
    More actions

    According to git bisect, this is due to 18c1a8d

  4. vstinner commented on Aug 6, 2024

    @vstinner
    vstinner
    on Aug 6, 2024
    MemberAuthor
    More actions

    cc @gpshead @encukou who authored the change introducing the regression.

  5. encukou
    added
    topic-ctypes
    on Aug 26, 2024
  6. hroncok commented on Oct 16, 2024

    @hroncok
    hroncok
    on Oct 16, 2024
    Contributor
    More actions

    We see this on Fedora i686 as well.

    Reacted by Matěj Cepl
  7. mcepl commented on Oct 17, 2024

    @mcepl
    mcepl
    on Oct 17, 2024
    Contributor
    More actions

    Yes, the same on openSUSE with 3.14.0~a1. Works on x86_64, but breaks on 32bit i586.

    Complete build log.

  8. encukou
    self-assigned this
    on Oct 18, 2024
  9. encukou commented on Oct 18, 2024

    @encukou
    encukou
    on Oct 18, 2024
    Member
    More actions

    I'll fix it by alpha 2

    Reacted by Miro Hrončok, Victor Stinner and Zachary Ware
  10. encukou
    added a commit that references this issue on Oct 23, 2024

    pythongh-121938: ctypes: Skip test of _pack_-ed struct with c_int64 o…

    77d3ee7
  11. encukou commented on Oct 23, 2024

    @encukou
    encukou
    on Oct 23, 2024
    Member
    More actions

    Took a while, but I'm now convinced that skipping this test is the correct thing to do.

    The test code to generate an C struct equivalent to a ctypes struct is far from perfect.

    Reacted by Zachary Ware
  12. zware
    added a commit that references this issue on Oct 23, 2024

    gh-121938: ctypes: Skip test of _pack_-ed struct with c_int64 on x86 (G…

    13c9fa3
  13. encukou
    closed this as completedon Oct 24, 2024
  14. ebonnal
    added a commit that references this issue on Jan 12, 2025

    pythongh-121938: ctypes: Skip test of _pack_-ed struct with c_int64 o…

    4cc9531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @encukou
    encukou

Labels

testsTests in the Lib/test dirTests in the Lib/test dirtopic-ctypestype-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.