GeezerVison is showing github.com — gh-106078: Suppress the warning caused by multi-phase initialization of `decimal` by CharlieZhao95 · Pull Request #107524 · python/cpython
Conversation
CharlieZhao95
commented
Aug 1, 2023
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
>>> python -m test test_decimal
Running Release|x64 interpreter...
0:00:00 Run tests sequentially
0:00:00 [1/1] test_decimal
...: warning: mpd_setminalloc: ignoring request to set MPD_MINALLOC a second time
This warnning is caused by the multi-phase initialization of decimal module. When decimal module is repeatedly imported, decimal_exec will be executed multiple times and this warning will be raised.
See #107287 (comment) for details.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Maybe we can skip news for this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It looks like the global variable check is failing, the tool cannot ignore static variables inside functions. Adding
__attribute__((constructor)) might be a more elegant option.
Forget this. Unfortunately, there is no equivalent for __attribute__((constructor)) on Windows.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it locally, and it works. Multiple imports of decimal doesn't make any warnings anymore.
LGTM.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
CharlieZhao95 reacted with hooray emoji
AlexWaygood
commented
Oct 3, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
The warning that's being suppressed here was recently brought up again in #110266
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
CharlieZhao95 reacted with eyes emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x RHEL7 LTO + PGO 3.x has failed when building commit de10522.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/244/builds/5628) and take a look at the build logs.
- Check if the failure is related to this commit (de10522) or if it is a false positive.
- 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/244/builds/5628
Summary of the results of the build (if available):
==
Click to see traceback logs
Note: checking out 'de1052245f67d5c5a5dbb4f39449f7687f58fd78'.
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 performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at de10522... gh-106078: Suppress the warning caused by multi-phase initialization of `decimal` (#107524)
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]: [clean-retain-profile] Error 1 (ignored)
Python/instrumentation.c: In function ‘allocate_instrumentation_data’:
Python/instrumentation.c:1497:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->local_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1497:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
Python/instrumentation.c:1498:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->active_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1498:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
Objects/bytes_methods.c: In function ‘find_internal’:
Objects/bytes_methods.c:526:31: warning: ‘subobj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0)
^
Objects/bytes_methods.c: In function ‘_Py_bytes_find’:
Objects/bytes_methods.c:526:31: warning: ‘subobj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Objects/bytes_methods.c:513:15: note: ‘subobj’ was declared here
PyObject *subobj;
^
Objects/bytes_methods.c: In function ‘_Py_bytes_rfind’:
Objects/bytes_methods.c:526:31: warning: ‘subobj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (PyObject_GetBuffer(subobj, &subbuf, PyBUF_SIMPLE) != 0)
^
Objects/bytes_methods.c:513:15: note: ‘subobj’ was declared here
PyObject *subobj;
^
Objects/bytes_methods.c: In function ‘_Py_bytes_count’:
Objects/bytes_methods.c:675:31: warning: ‘sub_obj’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (PyObject_GetBuffer(sub_obj, &vsub, PyBUF_SIMPLE) != 0)
^
Python/instrumentation.c: In function ‘allocate_instrumentation_data’:
Python/instrumentation.c:1497:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->local_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1497:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
Python/instrumentation.c:1498:9: warning: missing braces around initializer [-Wmissing-braces]
code->_co_monitoring->active_monitors = (_Py_LocalMonitors){ 0 };
^
Python/instrumentation.c:1498:9: warning: (near initialization for ‘(anonymous).tools’) [-Wmissing-braces]
Python/pytime.c: In function ‘pytime_mul’:
Python/pytime.c:1388:1: note: correcting inconsistent profile data
}
^
./Modules/_io/clinic/fileio.c.h: In function ‘_io_FileIO_close’:
./Modules/_io/fileio.c:175:32: warning: ‘exc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
_PyErr_ChainExceptions1(exc);
^
./Modules/_io/fileio.c:160:15: note: ‘exc’ was declared here
PyObject *exc;
^
./Modules/_io/clinic/textio.c.h: In function ‘_io_TextIOWrapper_seek’:
./Modules/_io/textio.c:2601:45: warning: ‘MEM[(char * {ref-all})&cookie + 20B]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
decoded = PyObject_CallMethodObjArgs(self->decoder, &_Py_ID(decode),
^
./Modules/_io/textio.c:2452:17: note: ‘MEM[(char * {ref-all})&cookie + 20B]’ was declared here
cookie_type cookie;
^
./Modules/_io/textio.c:2610:54: warning: ‘MEM[(char * {ref-all})&cookie + 16B]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (PyUnicode_GetLength(self->decoded_chars) < cookie.chars_to_skip) {
^
./Modules/_io/textio.c:2452:17: note: ‘MEM[(char * {ref-all})&cookie + 16B]’ was declared here
cookie_type cookie;
^
./Modules/_io/textio.c:2420:40: warning: ‘MEM[(char * {ref-all})&cookie + 8B]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return _textiowrapper_encoder_reset(
^
./Modules/_io/textio.c:2452:17: note: ‘MEM[(char * {ref-all})&cookie + 8B]’ was declared here
cookie_type cookie;
^
./Modules/_io/textio.c:2420:40: warning: ‘MEM[(char * {ref-all})&cookie]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return _textiowrapper_encoder_reset(
^
./Modules/_io/textio.c:2452:17: note: ‘MEM[(char * {ref-all})&cookie]’ was declared here
cookie_type cookie;
^
make: *** [buildbottest] Error 5
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
Eclips4
Eclips4 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|