New submission from Martin Panter: Once or twice I have had the math or cmath modules fail to build. There seems to be a race condition, because the _math.c file seems to be compiled twice, once for each module. Attached is a GCC wrapper that should help reproduce this fairly consistently. First, build Python normally:
$ ./configure $ make -j2 Then force Modules/_math.c to be recompiled using my wrapper script to amplify the race condition: $ touch Modules/_math.c $ rm build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o $ make -j2 CC=./slow-cc.py running build running build_ext building 'cmath' extension compiling for cmath ./slow-cc.py [. . .]/Modules/cmathmodule.o building 'math' extension ./slow-cc.py [. . .]/Modules/mathmodule.o ./slow-cc.py -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I./Include -I. -IInclude -I/usr/local/include -I/media/disk/home/proj/python/cpython/Include -I/media/disk/home/proj/python/cpython -c /media/disk/home/proj/python/cpython/Modules/_math.c -o build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o INITIAL COMPILE ./slow-cc.py -fPIC -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I./Include -I. -IInclude -I/usr/local/include -I/media/disk/home/proj/python/cpython/Include -I/media/disk/home/proj/python/cpython -c /media/disk/home/proj/python/cpython/Modules/_math.c -o build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o RECOMPILE RECOMPIILE TRUNCATING INITIAL COMPILE FINISHED ./slow-cc.py -shared build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/mathmodule.o build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o -L/usr/local/lib -lm -o build/lib.linux-x86_64-3.6/math.cpython-36m-x86_64-linux-gnu.so build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o: file not recognized: File truncated collect2: error: ld returned 1 exit status RECOMPILE FINISHED ./slow-cc.py -shared build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/cmathmodule.o build/temp.linux-x86_64-3.6/media/disk/home/proj/python/cpython/Modules/_math.o -L/usr/local/lib -lm -o build/lib.linux-x86_64-3.6/cmath.cpython-36m-x86_64-linux-gnu.so Failed to build these modules: math ---------- components: Build files: slow-cc.py messages: 245121 nosy: vadmium priority: normal severity: normal status: open title: Race condition compiling Modules/_math.c type: behavior Added file: http://bugs.python.org/file39672/slow-cc.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24421> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com