Skip to content

gh-102509: Ignore acceptable access of an uninitialized value #102838

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Ignore acceptable access of an uninitialized value to fix building
``--with-memory-sanitizer``. Patch by Illia Volochii.
1 change: 1 addition & 0 deletions Misc/README
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ README The file you're reading now
README.AIX Information about using Python on AIX
README.coverity Information about running Coverity's Prevent on Python
README.valgrind Information for Valgrind users, see valgrind-python.supp
sanitize-ignorelist.txt Entities to be ignored by sanitizers
SpecialBuilds.txt Describes extra symbols you can set for debug builds
svnmap.txt Map of old SVN revs and branches to hg changeset ids,
help history-digging
Expand Down
12 changes: 12 additions & 0 deletions Misc/sanitize-ignorelist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# This is a file listing entities to be ignored by sanitizers.
# https://clang.llvm.org/docs/SanitizerSpecialCaseList.html
#

[memory]
# medium_value called by maybe_small_long accesses an uninitialized
# integer in the case of PyLong of size 0, but the integer is then
# multiplied by zero immediately, so the lack of initialisation has no
# adverse effect.
# https://github.com/python/cpython/issues/102509
fun:maybe_small_long
4 changes: 2 additions & 2 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3102,8 +3102,8 @@ AC_ARG_WITH(memory_sanitizer,
[
AC_MSG_RESULT($withval)
AX_CHECK_COMPILE_FLAG([-fsanitize=memory],[
BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS"
LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS"
BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -fsanitize-ignorelist=Misc/sanitize-ignorelist.txt $BASECFLAGS"
LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-ignorelist=Misc/sanitize-ignorelist.txt $LDFLAGS"
],[AC_MSG_ERROR([The selected compiler doesn't support memory sanitizer])])
# MSan works by controlling memory allocation, our own malloc interferes.
with_pymalloc="no"
Expand Down