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

Quiche build failure under gcc #10422

Closed
dmitri-d opened this issue Mar 17, 2020 · 16 comments · Fixed by #13949
Closed

Quiche build failure under gcc #10422

dmitri-d opened this issue Mar 17, 2020 · 16 comments · Fixed by #13949
Assignees

Comments

@dmitri-d
Copy link
Contributor

Quiche fails to build under gcc (9.2.x) with the following error:

FAIL: //test/extensions/grpc_credentials/aws_iam:aws_iam_grpc_credentials_test (see /build/tmp/_bazel_bazel/b570b5ccd0454dc9af9f65ab1833764d/execroot/envoy/bazel-out/k8-opt/testlogs/test/extensions/grpc_credentials/aws_iam/aws_iam_grpc_credentials_test/test.log)
INFO: From Testing //test/extensions/grpc_credentials/aws_iam:aws_iam_grpc_credentials_test:
ERROR: /build/tmp/_bazel_bazel/b570b5ccd0454dc9af9f65ab1833764d/external/com_googlesource_quiche/BUILD.bazel:1988:1: C++ compilation of rule '@com_googlesource_quiche//:quic_core_framer_lib' failed (Exit 1)
bazel-out/k8-opt/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc: In member function 'bool quic::QuicFramer::AppendIetfAckFrameAndTypeByte(const quic::QuicAckFrame&, quic::QuicDataWriter*)':
bazel-out/k8-opt/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc:5420:40: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         writer->remaining() - ecn_size <
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
             QuicDataWriter::GetVarInt62Len(gap) +
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 QuicDataWriter::GetVarInt62Len(ack_range)) {
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@dmitri-d
Copy link
Contributor Author

Line numbers have changed since I reported the issue:

bazel-out/k8-opt/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc: In member function 'bool quic::QuicFramer::AppendIetfAckFrameAndTypeByte(const quic::QuicAckFrame&, quic::QuicDataWriter*)':
bazel-out/k8-opt/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc:5434:40: error: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]
 5434 |         writer->remaining() - ecn_size <
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 5435 |             QuicDataWriter::GetVarInt62Len(gap) +
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 5436 |                 QuicDataWriter::GetVarInt62Len(ack_range)) {
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@danzh2010
Copy link
Contributor

/assign @danzh2010

ls-saint pushed a commit to ls-saint/quiche that referenced this issue May 6, 2020
Reported in:
envoyproxy/envoy#10422 of -Wsign-compare under GCC.
envoyproxy/envoy#10767 of missing copy assignment under clang10.

PiperOrigin-RevId: 309489267
Change-Id: I69cb5ed3a6b1bd447da44bb241c3d81bf73865ab
@stale
Copy link

stale bot commented May 23, 2020

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label May 23, 2020
@stale
Copy link

stale bot commented May 31, 2020

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed May 31, 2020
@kkHAIKE
Copy link
Contributor

kkHAIKE commented Sep 22, 2020

same issus after #13066

@wrowe wrowe reopened this Sep 23, 2020
@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Sep 23, 2020
@wrowe
Copy link
Contributor

wrowe commented Sep 23, 2020

See the same, specific details I encountered with ubuntu 18.04 GCC as documented in this comment; #12898 (comment)

@ghost
Copy link

ghost commented Sep 28, 2020

We are also getting the same build failure

ERROR: /root/.cache/bazel/_bazel_root/0bedc29ce814c783e9af4c990605c934/external/com_googlesource_quiche/BUILD.bazel:2170:17: C++ compilation of rule '@com_googlesource_quiche//:quic_core_framer_lib' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 272 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-fastbuild/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc: In member function 'bool quic::QuicFramer::AppendIetfAckFrameAndTypeByte(const quic::QuicAckFrame&, quic::QuicDataWriter*)':
bazel-out/k8-fastbuild/bin/external/com_googlesource_quiche/quiche/quic/core/quic_framer.cc:5546:61: error: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare]
5546 | static_cast<size_t>(writer->remaining() - ecn_size) <
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
5547 | QuicDataWriter::GetVarInt62Len(gap) +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5548 | QuicDataWriter::GetVarInt62Len(ack_range)) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@NomadXD
Copy link
Contributor

NomadXD commented Nov 4, 2020

Hi I am getting the same build failure. I'm trying to build on ubuntu 20.04. My specs are as follows.

  • bazel 3.4.1
  • gcc 9.3.0
  • g++ 9.3.0

When I try to run bazel build //:envoy I get the following error.
ERROR: /home/khadija/.cache/bazel/_bazel_khadija/67b71b3527ed4854635b017e6b6cd642/external/com_googlesource_quiche/BUILD.bazel:2170:17: C++ compilation of rule '@com_googlesource_quiche//:quic_core_framer_lib' failed (Exit 1): gcc failed: error executing command (cd /home/khadija/.cache/bazel/_bazel_khadija/67b71b3527ed4854635b017e6b6cd642/sandbox/linux-sandbox/2634/execroot/envoy_filter_example && \ exec env - \ BAZEL_LINKLIBS=-l%:libstdc++.a \ BAZEL_LINKOPTS=-lm \ CC=gcc \ CXX=g++ \ PATH=/home/khadija/.cache/bazelisk/downloads/bazelbuild/bazel-3.4.1-linux-x86_64/bin:/usr/lib/llvm-8/bin:/home/khadija/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin \ PWD=/proc/self/cwd \

And it fails the build giving the following stacktrace.
[-Werror=sign-compare] 5546 | static_cast<size_t>(writer->remaining() - ecn_size) < | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 5547 | QuicDataWriter::GetVarInt62Len(gap) + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5548 | QuicDataWriter::GetVarInt62Len(ack_range)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ At global scope: cc1plus: error: unrecognized command line option '-Wno-range-loop-analysis' [-Werror] cc1plus: all warnings being treated as errors Target //:envoy failed to build

Any solution ?

@thomas1984
Copy link

@NomadXD
Hello! Please check the Readme document and perform some operations on the Linux system:
Linux
On Linux, we recommend using the prebuilt Clang+LLVM package from LLVM official site. Extract the tar.xz and run the following:

bazel/setup_clang.sh <PATH_TO_EXTRACTED_CLANG_LLVM>
This will setup a clang.bazelrc file in Envoy source root. If you want to make clang as default, run the following:

echo "build --config=clang" >> user.bazelrc
Note: Either libc++ or libstdc++-7-dev (or higher) must be installed.

I didn’t execute the setup_clang.sh command before, and I got the same error as yours. I downloaded a copy of clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz. After decompression and execution, the compilation succeeded. , I hope this can help you!

@NomadXD
Copy link
Contributor

NomadXD commented Dec 7, 2020

@thomas1984 Thanks for the reply and sorry I didn't have time to check for couple of weeks. I tried that but still no luck. I did the following steps.

git clone https://github.com/envoyproxy/envoy-filter-example.git
cd envoy-filter-example
git submodule update --init
cd envoy
git checkout v1.16.0
bazel/setup_clang.sh ~/Downloads/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04
cd ..
bazel build //http-filter-example:envoy --config=clang

I am getting the following error.

ERROR: /home/khadija/.cache/bazel/_bazel_khadija/b8963e6f21a84c9e75cda0cff04a3eb5/external/envoy/source/common/common/BUILD:321:23: C++ compilation of rule '@envoy//source/common/common:thread_impl_lib_posix' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 70 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: unrecognized command line option '-fno-limit-debug-info'
gcc: error: unrecognized command line option '-Wgnu-conditional-omitted-operand'
gcc: error: unrecognized command line option '-Wc++2a-extensions'; did you mean '-fms-extensions'?
gcc: error: unrecognized command line option '-Wrange-loop-analysis'
Target //http-filter-example:envoy failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.718s, Critical Path: 0.40s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

I think clang doesn't get configured and thats why there's a gcc error there. Any idea ?

@cooperkuo
Copy link

Same issue when using envoyproxy image with gcc9 inside.
The reason I have to use gcc is that our project links some libraries compiled by gcc instead of clang, it seems that it's as difficult to re-compile them as compiling newer envoyproxy using gcc.
It is much appreciate to get an official gcc-way to update our envoyproxy :)

@danzh2010
Copy link
Contributor

This issue should have been fixed in QUICHE and merged into Envoy in #13949.

@NomadXD
Copy link
Contributor

NomadXD commented Dec 14, 2020

@cooperkuo yeah it's a valid issue i think. lot of people had the same issue and noone gave a proper answer or a way to fix. I tried using clang also but still no luck. :-(

@dmitri-d
Copy link
Contributor Author

Use --sandbox_debug to see verbose messages from the sandbox
gcc: error: unrecognized command line option '-fno-limit-debug-info'
gcc: error: unrecognized command line option '-Wgnu-conditional-omitted-operand'
gcc: error: unrecognized command line option '-Wc++2a-extensions'; did you mean '-fms-extensions'?
gcc: error: unrecognized command line option '-Wrange-loop-analysis'

clang config generated in envoy submodule isn't being picked up by bazel when building from http-filter-example's main dir. envoyproxy/envoy-filter-example#139 should fix the issue.

@NomadXD
Copy link
Contributor

NomadXD commented Dec 15, 2020

@dmitri-d Thanks a lot for the tip. Was able to build successfully. Can you build it successfully using gcc as well ? I'm kinda new to envoy and it's ecosystem, so just trying explore everything.

@NomadXD
Copy link
Contributor

NomadXD commented Dec 15, 2020

@danzh2010 Thanks a lot for the info. Earlier I was trying to build v1.16.0. But now since the quiche build issue is fixed after that , I tried to build the master. Now I am not getting a Quiche build failure but getting the following error.

gcc: fatal error: cannot execute '/usr/lib/gcc/x86_64-linux-gnu/9/cc1plus': execv: Argument list too long

I googled it and seems like it's not something specific to envoy. I think it's related to ARG_MAX value and stack size allocated for params. I'm referring to this https://www.linuxquestions.org/questions/linux-kernel-70/argument-list-too-long-922171/

In the error stack trace I have this part,

gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 1392 argument(s) skipped)

which I guess related to this stack size issue.

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

Successfully merging a pull request may close this issue.

8 participants