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

gh-116099: Fix refcounting bug in _queueobj_shared() #116164

Merged

Conversation

swtaarrs
Copy link
Member

This code decrefs qidobj twice in some paths. Since qidobj isn't used after the first Py_DECREF(), remove the others, and replace the Py_DECREF() with Py_CLEAR() to make it clear that the variable is dead.

With this fix, python -mtest test_interpreters -R 3:3 -mtest_queues no longer fails with _Py_NegativeRefcount: Assertion failed: object has negative ref count.

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericsnowcurrently ericsnowcurrently enabled auto-merge (squash) February 29, 2024 22:36
@swtaarrs
Copy link
Member Author

swtaarrs commented Mar 1, 2024

The macOS builds have been queued for over 1.5 hours. Considering how unlikely they are to find something on this change that the Linux/Windows builds didn't, would it be worth merging before they're done (to fix the refleak buildbot)?

@colesbury
Copy link
Contributor

This PR is next in queue so it should start soon: https://github.com/python/cpython/actions?query=is%3Aqueued

I don't think there's a way to land PRs without the required tests passing (or changing the GitHub project configuration).

@ericsnowcurrently ericsnowcurrently merged commit 2e94a66 into python:main Mar 1, 2024
36 checks passed
@ericsnowcurrently
Copy link
Member

Thanks again for doing this, @swtaarrs!

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian PGO 3.x has failed when building commit 2e94a66.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/249/builds/7900) and take a look at the build logs.
  4. Check if the failure is related to this commit (2e94a66) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/249/builds/7900

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 4, done.        
remote: Counting objects:  25% (1/4)        
remote: Counting objects:  50% (2/4)        
remote: Counting objects:  75% (3/4)        
remote: Counting objects: 100% (4/4)        
remote: Counting objects: 100% (4/4), done.        
remote: Compressing objects:  33% (1/3)        
remote: Compressing objects:  66% (2/3)        
remote: Compressing objects: 100% (3/3)        
remote: Compressing objects: 100% (3/3), done.        
remote: Total 4 (delta 1), reused 2 (delta 1), pack-reused 0        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '2e94a6687c1a9750e9d2408a8dff0a422aeaf0e4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2e94a6687c1 gh-116099: Fix refcounting bug in `_queueobj_shared()` (gh-116164)
Switched to and reset branch 'main'

find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
find: ‘build’: No such file or directory
make[2]: [Makefile:2996: clean-retain-profile] Error 1 (ignored)
./Modules/_xxinterpqueuesmodule.c: In function ‘queuesmod_get’:
./Modules/_xxinterpqueuesmodule.c:1430:21: warning: ‘fmt’ may be used uninitialized [-Wmaybe-uninitialized]
 1430 |     PyObject *res = Py_BuildValue("Oi", obj, fmt);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/_xxinterpqueuesmodule.c:1420:9: note: ‘fmt’ was declared here
 1420 |     int fmt;
      |         ^~~
./Modules/readline.c: In function ‘setup_readline’:
./Modules/readline.c:1305:21: warning: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(const char *, int)’ [-Wincompatible-pointer-types]
 1305 |     rl_startup_hook = on_startup_hook;
      |                     ^
./Modules/readline.c:1307:23: warning: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(const char *, int)’ [-Wincompatible-pointer-types]
 1307 |     rl_pre_input_hook = on_pre_input_hook;
      |                       ^
./Modules/_xxinterpqueuesmodule.c: In function ‘queuesmod_get’:
./Modules/_xxinterpqueuesmodule.c:1430:21: warning: ‘fmt’ may be used uninitialized [-Wmaybe-uninitialized]
 1430 |     PyObject *res = Py_BuildValue("Oi", obj, fmt);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/_xxinterpqueuesmodule.c:1420:9: note: ‘fmt’ was declared here
 1420 |     int fmt;
      |         ^~~
In function ‘word_to_string’,
    inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:410:13,
    inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:611:18:
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:359:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  359 |     case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:358:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  358 |     case 16: EXTRACT_DIGIT(s, x, 1000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:359:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  359 |     case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         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 14: EXTRACT_DIGIT(s, x, 10000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:357:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  357 |     case 17: EXTRACT_DIGIT(s, x, 10000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:356:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  356 |     case 18: EXTRACT_DIGIT(s, x, 100000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:357:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  357 |     case 17: EXTRACT_DIGIT(s, x, 10000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:358:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  358 |     case 16: EXTRACT_DIGIT(s, x, 1000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:361:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  361 |     case 13: EXTRACT_DIGIT(s, x, 1000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         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 14: EXTRACT_DIGIT(s, x, 10000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:361:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  361 |     case 13: EXTRACT_DIGIT(s, x, 1000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:362:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  362 |     case 12: EXTRACT_DIGIT(s, x, 100000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:363:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  363 |     case 11: EXTRACT_DIGIT(s, x, 10000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:362:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  362 |     case 12: EXTRACT_DIGIT(s, x, 100000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:363:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  363 |     case 11: EXTRACT_DIGIT(s, x, 10000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:365:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  365 |     case 10: EXTRACT_DIGIT(s, x, 1000000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:366:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  366 |     case 9:  EXTRACT_DIGIT(s, x, 100000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:365:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  365 |     case 10: EXTRACT_DIGIT(s, x, 1000000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:366:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  366 |     case 9:  EXTRACT_DIGIT(s, x, 100000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:367:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  367 |     case 8:  EXTRACT_DIGIT(s, x, 10000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:368:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  368 |     case 7:  EXTRACT_DIGIT(s, x, 1000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:367:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  367 |     case 8:  EXTRACT_DIGIT(s, x, 10000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:368:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  368 |     case 7:  EXTRACT_DIGIT(s, x, 1000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:369:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  369 |     case 6:  EXTRACT_DIGIT(s, x, 100000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:370:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  370 |     case 5:  EXTRACT_DIGIT(s, x, 10000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:371:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  371 |     case 4:  EXTRACT_DIGIT(s, x, 1000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:369:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  369 |     case 6:  EXTRACT_DIGIT(s, x, 100000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:370:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  370 |     case 5:  EXTRACT_DIGIT(s, x, 10000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:371:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  371 |     case 4:  EXTRACT_DIGIT(s, x, 1000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:372:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  372 |     case 3:  EXTRACT_DIGIT(s, x, 100UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:372:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  372 |     case 3:  EXTRACT_DIGIT(s, x, 100UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:373:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  373 |     case 2:  EXTRACT_DIGIT(s, x, 10UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:373:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  373 |     case 2:  EXTRACT_DIGIT(s, x, 10UL, dot);
      |              ^~~~~~~~~~~~~
In function ‘word_to_string’,
    inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:410:13,
    inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:607:18:
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:359:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  359 |     case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:358:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  358 |     case 16: EXTRACT_DIGIT(s, x, 1000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:359:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  359 |     case 15: EXTRACT_DIGIT(s, x, 100000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         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 14: EXTRACT_DIGIT(s, x, 10000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:357:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  357 |     case 17: EXTRACT_DIGIT(s, x, 10000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:356:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  356 |     case 18: EXTRACT_DIGIT(s, x, 100000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:357:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  357 |     case 17: EXTRACT_DIGIT(s, x, 10000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:358:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  358 |     case 16: EXTRACT_DIGIT(s, x, 1000000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:361:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  361 |     case 13: EXTRACT_DIGIT(s, x, 1000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         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 14: EXTRACT_DIGIT(s, x, 10000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:361:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  361 |     case 13: EXTRACT_DIGIT(s, x, 1000000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:362:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  362 |     case 12: EXTRACT_DIGIT(s, x, 100000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:363:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  363 |     case 11: EXTRACT_DIGIT(s, x, 10000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:362:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  362 |     case 12: EXTRACT_DIGIT(s, x, 100000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:363:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  363 |     case 11: EXTRACT_DIGIT(s, x, 10000000000ULL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:365:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  365 |     case 10: EXTRACT_DIGIT(s, x, 1000000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:366:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  366 |     case 9:  EXTRACT_DIGIT(s, x, 100000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:365:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  365 |     case 10: EXTRACT_DIGIT(s, x, 1000000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:366:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  366 |     case 9:  EXTRACT_DIGIT(s, x, 100000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:367:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  367 |     case 8:  EXTRACT_DIGIT(s, x, 10000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:368:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  368 |     case 7:  EXTRACT_DIGIT(s, x, 1000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:367:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  367 |     case 8:  EXTRACT_DIGIT(s, x, 10000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:368:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  368 |     case 7:  EXTRACT_DIGIT(s, x, 1000000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:369:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  369 |     case 6:  EXTRACT_DIGIT(s, x, 100000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:370:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  370 |     case 5:  EXTRACT_DIGIT(s, x, 10000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:369:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  369 |     case 6:  EXTRACT_DIGIT(s, x, 100000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:370:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  370 |     case 5:  EXTRACT_DIGIT(s, x, 10000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:371:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  371 |     case 4:  EXTRACT_DIGIT(s, x, 1000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:372:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  372 |     case 3:  EXTRACT_DIGIT(s, x, 100UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:373:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  373 |     case 2:  EXTRACT_DIGIT(s, x, 10UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:371:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  371 |     case 4:  EXTRACT_DIGIT(s, x, 1000UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:372:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  372 |     case 3:  EXTRACT_DIGIT(s, x, 100UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  348 |         if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
      |                                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:373:14: note: in expansion of macro ‘EXTRACT_DIGIT’
  373 |     case 2:  EXTRACT_DIGIT(s, x, 10UL, dot);
      |              ^~~~~~~~~~~~~
./Modules/readline.c: In function ‘setup_readline’:
./Modules/readline.c:1305:21: warning: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(const char *, int)’ [-Wincompatible-pointer-types]
 1305 |     rl_startup_hook = on_startup_hook;
      |                     ^
./Modules/readline.c:1307:23: warning: assignment to ‘int (*)(void)’ from incompatible pointer type ‘int (*)(const char *, int)’ [-Wincompatible-pointer-types]
 1307 |     rl_pre_input_hook = on_pre_input_hook;
      |                       ^
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘doParseXmlDecl’ at ./Modules/expat/xmltok.c:1192:13:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘doParseXmlDecl’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1070:9:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1076:12:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1076:12:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1083:9:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1083:9:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1110:7:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1123:9:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~
In function ‘utf8_toUtf8’,
    inlined from ‘toAscii’ at ./Modules/expat/xmltok.c:1038:3,
    inlined from ‘parsePseudoAttribute’ at ./Modules/expat/xmltok.c:1123:9:
./Modules/expat/xmltok.c:392:5: warning: ‘memcpy’ writing 2 or more bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
  392 |     memcpy(*toP, *fromP, bytesToCopy);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./Modules/expat/xmltok.c: In function ‘parsePseudoAttribute’:
./Modules/expat/xmltok.c:1036:8: note: destination object ‘buf’ of size 1
 1036 |   char buf[1];
      |        ^~~

make: *** [Makefile:2151: buildbottest] Error 3

@ericsnowcurrently
Copy link
Member

FYI, I'm pretty sure that buildbot failure is unrelated.

woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…h-116164)

This code decrefs `qidobj` twice in some paths. Since `qidobj` isn't used after
the first `Py_DECREF()`, remove the others, and replace the `Py_DECREF()` with
`Py_CLEAR()` to make it clear that the variable is dead.

With this fix, `python -mtest test_interpreters -R 3:3 -mtest_queues` no longer
fails with `_Py_NegativeRefcount: Assertion failed: object has negative ref
count`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_interpreters fails when running with -R 3:3 argument
5 participants