Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

_align_ = 0 segfaults when used with empty filed list (_fields_ = []) #132673

Closed
Assignees
sobolevn
Labels
3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirtopic-ctypestype-crashA hard crash of the interpreter, possibly with a core dump
@karas84

Description

@karas84

Crash report

What happened?

Tested on the latestubuntu:25.04 docker image.

fromctypesimportStructureclassMyStructure(Structure):_align_=0_fields_= []

Crashes withFloating point exception on CPython 3.13.

I'm attaching both gdb core dump and backtrace:dump.zip

Problem seems caused by_ctypes/stgdict.c:573:
aligned_size = ((size + total_align - 1) / total_align) * total_align;

Also tested on CPython 3.14, which doesn't segfaults but exits on an assert inctypes/_layout.py:19:
assert multiple > 0

called byctypes/_layout.py:314:
aligned_size = round_up(total_size, align)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.13.3 (main, Apr 8 2025, 19:55:40) [GCC 14.2.0]

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirtopic-ctypestype-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp