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

Optional support for ieee contexts in the decimal module doesn't work #122081

Closed
Labels
extension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump
@skirpichev

Description

@skirpichev

Crash report

What happened?

Reproducer:

$ ./configure CFLAGS=-DEXTRA_FUNCTIONALITY -q && make -sconfigure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)In function ‘word_to_string’,    inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:411:13,    inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:612:18:./Modules/_decimal/libmpdec/io.c:349:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]  349 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~./Modules/_decimal/libmpdec/io.c:360:14: note: in expansion of macro ‘EXTRACT_DIGIT’  360 |     case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);      |              ^~~~~~~~~~~~~[... and similar warnings from issue #108562, hardly relevant]Checked 112 modules (34 built-in, 77 shared, 1 n/a on linux-x86_64, 0 disabled, 0 missing, 0 failed on import)$ ./python Python 3.14.0a0 (heads/main:cecaceea31, Jul 19 2024, 05:34:00) [GCC 12.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> from decimal import *>>> IEEEContext(11)Traceback (most recent call last):  File "<python-input-1>", line 1, in <module>    IEEEContext(11)    ~~~~~~~~~~~^^^^ValueError: argument must be a multiple of 32, with a maximum of 512>>> IEEEContext(1024)Traceback (most recent call last):  File "<python-input-2>", line 1, in <module>    IEEEContext(1024)    ~~~~~~~~~~~^^^^^^ValueError: argument must be a multiple of 32, with a maximum of 512>>> IEEEContext(512)  # oopsSegmentation fault

There are tests (decorated by@requires_extra_functionality) for this, but it seems nobody (including build bots) run this a long time. These tests are broken too (crash).

I'll provide a patch.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

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

Python 3.14.0a0 (heads/fix-decimal-extra:c8d2630995, Jul 21 2024, 10:20:04) [GCC 12.2.0]

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-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