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

New warning on main: writing 1 byte into a region of size 0 [-Wstringop-overflow=] #129467

Closed
sobolevn opened this issue Jan 30, 2025 · 6 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jan 30, 2025

Bug report

Bug description:

This happens in Modules/_decimal/libmpdec/io.c
Here:

#define EXTRACT_DIGIT(s, x, d, dot) \
if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d

Image

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@sobolevn sobolevn added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Jan 30, 2025
@skirpichev
Copy link
Member

I doubt it's a new one, see #108562. See patch: #116346.

Probably someone (me?:)) should just post that to the mpdecimal maillist.

@skirpichev skirpichev added the pending The issue will be closed if no feedback is provided label Jan 30, 2025
@sobolevn
Copy link
Member Author

In any case, it affects our CI, so we should take appropriate steps to resolve this issue.

@skirpichev skirpichev removed the pending The issue will be closed if no feedback is provided label Jan 30, 2025
@skirpichev
Copy link
Member

Ok, #116346 restored.

@vstinner
Copy link
Member

Probably someone (me?:)) should just post that to the mpdecimal maillist.

Yes, otherwise, we will loose the patch next time that we update mpdecimal.

Note: we plan to remove the vendored libmpdecimal copy in Python 3.15: https://docs.python.org/dev/whatsnew/3.14.html#id11

@skirpichev
Copy link
Member

Yes

Stefan participated in the old issue thread. So, he is aware on the problem. If this patch wasn't included in 4.0.0 - maybe he consider this as a non-issue for the mpdecimal.

next time that we update mpdecimal

I don't think there is much sense to do this. The mpdecimal seems to be a complete project (implementation of the IBM spec). For bugfixes or performance improvements people should just use upstream sources.

Note: we plan to remove the vendored libmpdecimal copy in Python 3.15

(Someone should convince Debian people to restore mpdecimal package.)

vstinner pushed a commit that referenced this issue Jan 30, 2025
Turn off false-positive -Wstringop-overflow in word_to_string().
@vstinner
Copy link
Member

Fixed by the change 6c63afc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants