[issue34096] [2.7] test_audioop.test_max() failed: AssertionError: -2147483648 != 2147483648L

STINNER Victor report at bugs.python.org
Fri Jul 13 07:00:46 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

Extract of attached test.pythoninfo output:

sys.maxsize: 2147483647
sysconfig[PY_CFLAGS]: -fno-strict-aliasing -march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -I. -IInclude -I./Include -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE

I tried to reproduce the issue on my x86_64 Fedora 28 (64-bit) using:

   ./configure CFLAGS="-m32" LDFLAGS="-m32" && make

But I failed to reproduce the issue. I also tried to add "-fstack-protector-strong -fno-plt" but I still fail to reproduce the bug.

On interesting thing is that your CFLAGS don't contain -fwrapv. You can try the following command to check if gcc -v --help contains -fwrapv?

"gcc -v --help|grep -- -fwrapv"

With my french locale, for example, I see:

  -fwrapv                     Supposer que le débordement de l'arithmétique signée boucle sur la plage accessible.

You may try to force -fwrapv using ./configure CFLAGS="-fwrapv" or directly by adding directly the option to the OPT variable in Makefile. Example of options on my x86_64 Fedora and "./configure":

OPT=		-DNDEBUG -g -fwrapv -O3 -Wall
BASECFLAGS=	 -Wno-unused-result -Wsign-compare
CONFIGURE_CFLAGS_NODIST= -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration

Note: When Python is compiled with --with-pydebug, -fwrapv is not used.

Note: Your CFLAGS use -O2 whereas Python uses -O3 by default in release mode.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34096>
_______________________________________


More information about the Python-bugs-list mailing list