Skip to content

Commit

Permalink
Fix oss-fuzz build compilation errors (envoyproxy#18919)
Browse files Browse the repository at this point in the history
This PR fixes two compilation error that are happening in the oss-fuzz build of Envoy. Note that the latest oss-fuzz build errors out with only the error related to AsyncStream but AFAIR when it is fixed, a different compilation error has to be fixed which I fixed in the first commit that changes the socket.h file.


Fixes an oss-fuzz Envoy compilation error:
```
Execution platform: @local_config_platform//:host
In file included from source/common/network/socket_option_impl.cc:1:
In file included from ./source/common/network/socket_option_impl.h:6:
In file included from ./envoy/network/listen_socket.h:14:
./envoy/network/socket.h:26:3: error: definition of implicit copy assignment operator for 'SocketOptionName' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
  SocketOptionName(const SocketOptionName&) = default;
  ^
source/common/network/socket_option_impl.cc:52:14: note: in implicit copy assignment operator for 'Envoy::Network::SocketOptionName' first required here
  info.name_ = optname_;
             ^
1 error generated.
INFO: Elapsed time: 2620.084s, Critical Path: 126.35s
INFO: 4237 processes: 154 internal, 4083 local.
FAILED: Build did NOT complete successfully
ERROR:root:Building fuzzers failed.
```

Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>

* types_async_client.h: fix deprecated defaulted copy ctor

Fixes an oss-fuzz Envoy compilation error:
```
Step envoyproxy#3 - "compile-afl-address-x86_64": Execution platform: @local_config_platform//:host
Step envoyproxy#3 - "compile-afl-address-x86_64": In file included from source/extensions/filters/http/ext_proc/client_impl.cc:1:
Step envoyproxy#3 - "compile-afl-address-x86_64": In file included from ./source/extensions/filters/http/ext_proc/client_impl.h:11:
Step envoyproxy#3 - "compile-afl-address-x86_64": �[1m./source/common/grpc/typed_async_client.h:38:3: �[0m�[0;1;31merror: �[0m�[1mdefinition of implicit copy assignment operator for 'AsyncStream<envoy::service::ext_proc::v3::ProcessingRequest>' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]�[0m
Step envoyproxy#3 - "compile-afl-address-x86_64":   AsyncStream(const AsyncStream& other) = default;
Step envoyproxy#3 - "compile-afl-address-x86_64": �[0;1;32m  ^
Step envoyproxy#3 - "compile-afl-address-x86_64": �[0m�[1msource/extensions/filters/http/ext_proc/client_impl.cc:34:11: �[0m�[0;1;30mnote: �[0min implicit copy assignment operator for 'Envoy::Grpc::AsyncStream<envoy::service::ext_proc::v3::ProcessingRequest>' first required here�[0m
Step envoyproxy#3 - "compile-afl-address-x86_64":   stream_ = client_.start(*descriptor, *this, options);
Step envoyproxy#3 - "compile-afl-address-x86_64": �[0;1;32m          ^
Step envoyproxy#3 - "compile-afl-address-x86_64": �[0m1 error generated.
```

Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>

* socket.h: delete default assignment operator

Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>

* typed_async_client.h: remove default assignment op

Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>
Signed-off-by: Josh Perry <josh.perry@mx.com>
  • Loading branch information
disconnect3d authored and Josh Perry committed Feb 13, 2022
1 parent 0eff67d commit 6e512c9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions envoy/network/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ namespace Network {
// avoid #ifdef proliferation.
struct SocketOptionName {
SocketOptionName() = default;
SocketOptionName(const SocketOptionName&) = default;
SocketOptionName& operator=(const SocketOptionName&) = default;
SocketOptionName(int level, int option, const std::string& name)
: value_(std::make_tuple(level, option, name)) {}

Expand Down
2 changes: 0 additions & 2 deletions source/common/grpc/typed_async_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ template <typename Request> class AsyncStream /* : public RawAsyncStream */ {
public:
AsyncStream() = default;
AsyncStream(RawAsyncStream* stream) : stream_(stream) {}
AsyncStream(const AsyncStream& other) = default;
AsyncStream& operator=(const AsyncStream&) = default;
void sendMessage(const Protobuf::Message& request, bool end_stream) {
Internal::sendMessageUntyped(stream_, std::move(request), end_stream);
}
Expand Down

0 comments on commit 6e512c9

Please sign in to comment.