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

test_rosetta.py and test_cases.py fail with gcc-12 #2011

Open
drew-parsons opened this issue Jul 29, 2022 · 2 comments
Open

test_rosetta.py and test_cases.py fail with gcc-12 #2011

drew-parsons opened this issue Jul 29, 2022 · 2 comments

Comments

@drew-parsons
Copy link

drew-parsons commented Jul 29, 2022

Debian CI testing indicates that test_rosetta.py for pythran 0.11.0 fails with gcc-12. Reported in debian Bug#1016155, which links to a full test log. The tests were previously passing with gcc-11, test history is available here.

The reported error is in TestRosetta.test_repeat_string_run0, with final captured stderr:

_____________________ TestRosetta.test_repeat_string_run0 ______________________
...
E                   SystemExit: error: Command "x86_64-linux-gnu-gcc 
-pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall 
-g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv 
-O2 -g -fstack-protector-strong -Wformat -Werror=format-security 
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DENABLE_PYTHON_MODULE 
-D__PYTHRAN__=3 -DPYTHRAN_BLAS_BLAS 
-I/usr/lib/python3/dist-packages/pythran 
-I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/local/include 
-I/usr/include -I/usr/include/python3.10 -c /tmp/tmpg3nzvhc1.cpp -o 
/tmp/tmp98l70uwv/tmp/tmpg3nzvhc1.o -std=c++11 -fno-math-errno 
-fvisibility=hidden -fno-wrapv -Wno-unused-function 
-Wno-int-in-bool-context -Wno-unknown-warning-option -O0 -Wall -Werror 
-UNDEBUG -Wno-unused-function -Wno-int-in-bool-context 
-Wno-unknown-warning-option -Wno-unused-local-typedefs 
-Wno-missing-braces -Wno-unknown-pragmas" failed with exit status 1

/usr/lib/python3.10/distutils/core.py:163: SystemExit
...
----------------------------- Captured stderr call 
-----------------------------
/tmp/tmpg3nzvhc1.cpp: In instantiation of ‘struct 
__pythran_repeat_string_run00::test::type<long int>’:
/tmp/tmpg3nzvhc1.cpp:50:57:   required from here
/tmp/tmpg3nzvhc1.cpp:28:48: error: no matching function for call to 
‘mul({anonymous}::pythonic::types::str, long int)’
   28 |       typedef 
decltype(pythonic::operator_::mul(std::declval<__type0>(), 
std::declval<__type2>())) __type3;
      | 
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/numpy_operators.hpp:18,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/ndarray.hpp:1303,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/tuple.hpp:13,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/builtins/bool_.hpp:7,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/NoneType.hpp:8,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/slice.hpp:5,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/core.hpp:36,
                 from /tmp/tmpg3nzvhc1.cpp:1:
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/mul.hpp:15:8: 
note: candidate: ‘template<class A, class B> decltype ((forward<A>(a) * 
forward<B>(b))) {anonymous}::pythonic::operator_::mul(A&&, B&&)’
   15 |   auto mul(A &&a, B &&b) -> decltype(std::forward<A>(a) * 
std::forward<B>(b))
      |        ^~~
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/mul.hpp:15:8: 
note:   template argument deduction/substitution failed:
In file included from 
/usr/lib/python3/dist-packages/pythran/pythonic/include/types/numpy_operators.hpp:16,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/include/types/ndarray.hpp:996,
                 from 
/usr/lib/python3/dist-packages/pythran/pythonic/types/ndarray.hpp:4:
/usr/lib/python3/dist-packages/pythran/pythonic/include/operator_/mul.hpp: 
...

Trying to run pytest-3 -v test_rosetta.py manually from the command line, all tests fails with a slightly different error equivalent to

$ x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_BLAS -I/home/drew/projects/python/build/pythran/pythran -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/usr/include/suitesparse -I/usr/include/python3.10 -c /tmp/tmpn7tw1vbb.cpp -o /tmp/tmpxp8jww4a/tmp/tmpn7tw1vbb.o -std=c++11 -fno-math-errno -fvisibility=hidden -fno-wrapv -Wno-unused-function -Wno-int-in-bool-context -Wno-unknown-warning-option -O0 -Wall -Werror -UNDEBUG -Wno-unused-function -Wno-int-in-bool-context -Wno-unknown-warning-option -Wno-unused-local-typedefs -Wno-absolute-value -Wno-missing-braces -Wno-unknown-pragmas
cc1plus: error: command-line option ‘-Wno-absolute-value’ is valid for C/ObjC but not for C++ [-Werror]
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
@drew-parsons
Copy link
Author

pytest-3 -v test_rosetta.py now runs normally from the command line and reproduces the error. All tests pass except for test_repeat_string_run0, which gives the same error, "‘struct __pythran_repeat_string_run00::test::type’: error: no matching function for call to ‘mul({anonymous}::pythonic::types::str, long int)’"

@drew-parsons drew-parsons changed the title test_rosetta.py fails with gcc-12 test_rosetta.py and test_cases.py fail with gcc-12 Aug 7, 2022
@drew-parsons
Copy link
Author

The same kind of error also occurs in test_cases.py, see https://ci.debian.net/data/autopkgtest/unstable/amd64/p/pythran/24414284/log.gz.

Affected tests in TestCases are

  • test_multitype_run0
  • test_multitype_run1
  • test_multitype_run2
  • test_multitype_run3
  • test_multitype_run4
  • test_multitype_run5
  • test_multitype_run6
  • test_multitype_run7

The error has the same pattern

----------------------------- Captured stderr call -----------------------------
/tmp/tmpe3hf__h9.cpp: In instantiation of ‘struct __pythran_multitype_run00::times::type<{anonymous}::pythonic::types::str, long int>’:
/tmp/tmpe3hf__h9.cpp:243:76:   required from here
/tmp/tmpe3hf__h9.cpp:85:48: error: no matching function for call to ‘mul({anonymous}::pythonic::types::str, long int)’
   85 |       typedef decltype(pythonic::operator_::mul(std::declval<__type1>(), std::declval<__type3>())) __type4;
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/python3/dist-packages/pythran/pythonic/types/numpy_operators.hpp:18,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/ndarray.hpp:1303,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/tuple.hpp:13,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/builtins/bool_.hpp:7,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/NoneType.hpp:8,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/slice.hpp:5,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/core.hpp:36,
                 from /tmp/tmpe3hf__h9.cpp:1:
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/mul.hpp:15:8: note: candidate: ‘template<class A, class B> decltype ((forward<A>(a) * forward<B>(b))) {anonymous}::pythonic::operator_::mul(A&&, B&&)’
   15 |   auto mul(A &&a, B &&b) -> decltype(std::forward<A>(a) * std::forward<B>(b))
      |        ^~~
/usr/lib/python3/dist-packages/pythran/pythonic/operator_/mul.hpp:15:8: note:   template argument deduction/substitution failed:
In file included from /usr/lib/python3/dist-packages/pythran/pythonic/include/types/numpy_operators.hpp:16,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/include/types/ndarray.hpp:996,
                 from /usr/lib/python3/dist-packages/pythran/pythonic/types/ndarray.hpp:4:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant