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

core: duplicate symbols coming from protobuf #617

Closed
rebello95 opened this issue Dec 20, 2019 · 3 comments · Fixed by #618
Closed

core: duplicate symbols coming from protobuf #617

rebello95 opened this issue Dec 20, 2019 · 3 comments · Fixed by #618
Assignees
Labels
bug Something isn't working build core no stalebot

Comments

@rebello95
Copy link
Contributor

Overview

With the latest upstream Envoy update, we're seeing quite a few duplicate symbols coming from the final Envoy.framework. These symbols seem to be coming from protobuf. Here are a few examples:

05:06:52.047624 Found symbol '__ZN6google8protobuf28UninterpretedOption_NamePartC1ERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.047630 Found symbol '__ZNK6google8protobuf19EnumDescriptorProto13IsInitializedEv' in multiple binaries: Envoy, Envoy'
05:06:52.047839 Found symbol '__ZN6google8protobuf12OneofOptions9MergeFromERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.047865 Found symbol '_descriptor_table_google_2fprotobuf_2fdescriptor_2eproto' in multiple binaries: Envoy, Envoy'
05:06:52.047873 Found symbol '__ZN6google8protobuf11UInt64Value9MergeFromERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.047880 Found symbol '__ZNK6google8protobuf19UninterpretedOption39InternalSerializeWithCachedSizesToArrayEPhPNS0_2io19EpsCopyOutputStreamE' in multiple binaries: Envoy, Envoy'
05:06:52.047886 Found symbol '__ZN6google8protobuf19FileDescriptorProto8CopyFromERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.047895 Found symbol '__ZN6google8protobuf29DescriptorProto_ReservedRangeC2EPNS0_5ArenaE' in multiple binaries: Envoy, Envoy'
05:06:52.047906 Found symbol '__ZNK6google8protobuf28GeneratedCodeInfo_Annotation12ByteSizeLongEv' in multiple binaries: Envoy, Envoy'
05:06:52.047972 Found symbol '__ZNK6google8protobuf20FieldDescriptorProto12ByteSizeLongEv' in multiple binaries: Envoy, Envoy'
05:06:52.048006 Found symbol '__ZN6google8protobuf12FieldOptions10JSType_MINE' in multiple binaries: Envoy, Envoy'
05:06:52.048015 Found symbol '__ZN6google8protobuf28UninterpretedOption_NamePartC1EPNS0_5ArenaE' in multiple binaries: Envoy, Envoy'
05:06:52.048060 Found symbol '__ZTSN6google8protobuf11UInt64ValueE' in multiple binaries: Envoy, Envoy'
05:06:52.048072 Found symbol '__ZN6google8protobuf20FieldDescriptorProto12TYPE_FIXED64E' in multiple binaries: Envoy, Envoy'
05:06:52.048164 Found symbol '_scc_info_Empty_google_2fprotobuf_2fempty_2eproto' in multiple binaries: Envoy, Envoy'
05:06:52.048184 Found symbol '_scc_info_OneofOptions_google_2fprotobuf_2fdescriptor_2eproto' in multiple binaries: Envoy, Envoy'
05:06:52.048201 Found symbol '__ZNK6google8protobuf16EnumValueOptions39InternalSerializeWithCachedSizesToArrayEPhPNS0_2io19EpsCopyOutputStreamE' in multiple binaries: Envoy, Envoy'
05:06:52.048218 Found symbol '__ZN6google8protobuf11UInt32Value5ClearEv' in multiple binaries: Envoy, Envoy'
05:06:52.048261 Found symbol '__ZNK6google8protobuf11DoubleValue13IsInitializedEv' in multiple binaries: Envoy, Envoy'
05:06:52.048406 Found symbol '__ZN6google8protobuf20OneofDescriptorProtoD2Ev' in multiple binaries: Envoy, Envoy'
05:06:52.048434 Found symbol '__ZN6google8protobuf29DescriptorProto_ReservedRange21InitAsDefaultInstanceEv' in multiple binaries: Envoy, Envoy'
05:06:52.048448 Found symbol '__ZN6google8protobuf28GeneratedCodeInfo_AnnotationD2Ev' in multiple binaries: Envoy, Envoy'
05:06:52.048455 Found symbol '__ZN6google8protobuf23SourceCodeInfo_Location5ClearEv' in multiple binaries: Envoy, Envoy'
05:06:52.048461 Found symbol '__ZN6google8protobuf5Arena18CreateMaybeMessageINS0_30DescriptorProto_ExtensionRangeEJEEEPT_PS1_DpOT0_' in multiple binaries: Envoy, Envoy'
05:06:52.048637 Found symbol '__ZNK6google8protobuf13MethodOptions12ByteSizeLongEv' in multiple binaries: Envoy, Envoy'
05:06:52.048657 Found symbol '__ZN6google8protobuf17GeneratedCodeInfoD2Ev' in multiple binaries: Envoy, Envoy'
05:06:52.048739 Found symbol '__ZN6google8protobuf28_BoolValue_default_instance_E' in multiple binaries: Envoy, Envoy'
05:06:52.048756 Found symbol '__ZN6google8protobuf8Duration8CopyFromERKNS0_7MessageE' in multiple binaries: Envoy, Envoy'
05:06:52.048763 Found symbol '__ZN6google8protobuf11EnumOptionsD2Ev' in multiple binaries: Envoy, Envoy'
05:06:52.048770 Found symbol '__ZN6google8protobuf13MethodOptions26IdempotencyLevel_ARRAYSIZEE' in multiple binaries: Envoy, Envoy'
05:06:52.048911 Found symbol '__ZNK6google8protobuf19FileDescriptorProto13SetCachedSizeEi' in multiple binaries: Envoy, Envoy'
05:06:52.048926 Found symbol '__ZTSN6google8protobuf10BytesValueE' in multiple binaries: Envoy, Envoy'
05:06:52.048933 Found symbol '__ZN6google8protobuf13MethodOptionsC1ERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.048940 Found symbol '__ZN6google8protobuf6StructC1ERKS1_' in multiple binaries: Envoy, Envoy'
05:06:52.048993 Found symbol '__ZNK6google8protobuf11EnumOptions39InternalSerializeWithCachedSizesToArrayEPhPNS0_2io19EpsCopyOutputStreamE' in multiple binaries: Envoy, Envoy'
05:06:52.049002 Found symbol '__ZN6google8protobuf36_GeneratedCodeInfo_default_instance_E' in multiple binaries: Envoy, Envoy'
05:06:52.049008 Found symbol '__ZNK6google8protobuf11DoubleValue13SetCachedSizeEi' in multiple binaries: Envoy, Envoy'
05:06:52.049015 Found symbol '__ZN6google8protobuf17FileDescriptorSet14_InternalParseEPKcPNS0_8internal12ParseContextE' in multiple binaries: Envoy, Envoy'
05:06:52.049021 Found symbol '__ZN6google8protobuf12OneofOptionsC2EPNS0_5ArenaE' in multiple binaries: Envoy, Envoy'

These symbols can easily be dumped and searched using:

$ nm -arch arm64 -WUgj /path/to/Envoy.framework/Envoy

I tried going back several versions of Envoy, and found that the commit prior to the last protobuf bump to v3.10.1 did not have duplicate symbols. This leads me to believe that the protobuf bump commit resulted in duplication of these symbols.

Fixing

It's not yet clear to me whether this issue has been fixed by upstream fixes to protobuf, as v3.11.2 is now the latest release. We should try updating to see if this resolves the problem.

Updating protobuf

I started updating protobuf in Envoy, but it appears that a change to protobuf resulted in deprecations being surfaced as warnings, which subsequently causes Envoy Mobile not to compile due to the fact that Envoy uses some of these deprecated entities.

The same change in protobuf that started surfacing these warnings also added -Wno-deprecated-declarations, effectively disabling the warnings in the protobuf library itself. Thus, we can either:

  1. Silence these warnings in Envoy
  2. Investigate what it'll take to migrate off of the deprecated entities
@rebello95 rebello95 added bug Something isn't working no stalebot core build labels Dec 20, 2019
@rebello95 rebello95 self-assigned this Dec 20, 2019
@junr03
Copy link
Member

junr03 commented Dec 20, 2019

I wanted to surface another linking issue in iOS that @htuch and I discussed on an envoy PR: envoyproxy/envoy#9191

@keith
Copy link
Member

keith commented Dec 23, 2019

Filed some upstream issues that I believe to be the cause of this:

protocolbuffers/protobuf#7046
bazelbuild/bazel#10484

@rebello95
Copy link
Contributor Author

Thanks so much @keith.

There's a fix that has been submitted to fix this issue in Bazel, after which we should hopefully be able to bump Bazel and update: bazelbuild/bazel#10493

rebello95 added a commit that referenced this issue Dec 31, 2019
Fixes #617, which resulted in duplicate symbols from protobuf being present in the final Envoy Mobile binary.

The [root cause](bazelbuild/bazel#10484) is being [patched in Bazel](bazelbuild/bazel#10493). In the meantime, we can revert these two commits in protobuf ([first](protocolbuffers/protobuf@7b28278), [second](protocolbuffers/protobuf@a03d332)) and apply the diff as a patch until we're able to update Bazel with the fix. More context on the protobuf issue is available [here](protocolbuffers/protobuf#7046).

Notes:
- This should be reverted after updating Bazel with the fix
- The version of protobuf specified in the `http_archive` should be in lockstep with upstream Envoy's version
- Upstream Envoy's `@envoy//bazel:protobuf.patch` patch is also included here

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Yannic added a commit to Yannic/protobuf that referenced this issue Jan 8, 2020
This is a partial revert of protocolbuffers@7b28278 to unblock, e.g., grpc/grpc#21590 or envoyproxy/envoy-mobile#617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by protocolbuffers@7b28278 when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.
rafi-kamal pushed a commit to protocolbuffers/protobuf that referenced this issue Jan 9, 2020
* Blacklist .proto source files is Bazel allows us to

This is a partial revert of 7b28278 to unblock, e.g., grpc/grpc#21590 or envoyproxy/envoy-mobile#617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by 7b28278 when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.

* Remove trailing ,

* Update BUILD
rafi-kamal pushed a commit to protocolbuffers/protobuf that referenced this issue Jan 9, 2020
* Blacklist .proto source files is Bazel allows us to

This is a partial revert of 7b28278 to unblock, e.g., grpc/grpc#21590 or envoyproxy/envoy-mobile#617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by 7b28278 when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.

* Remove trailing ,

* Update BUILD
rafi-kamal pushed a commit to protocolbuffers/protobuf that referenced this issue Jan 9, 2020
* Blacklist .proto source files is Bazel allows us to

This is a partial revert of 7b28278 to unblock, e.g., grpc/grpc#21590 or envoyproxy/envoy-mobile#617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by 7b28278 when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.

* Remove trailing ,

* Update BUILD
@junr03 junr03 added this to the v0.3 "Secondi" milestone Feb 8, 2020
jpsim pushed a commit to envoyproxy/envoy that referenced this issue Nov 28, 2022
Fixes envoyproxy/envoy-mobile#617, which resulted in duplicate symbols from protobuf being present in the final Envoy Mobile binary.

The [root cause](bazelbuild/bazel#10484) is being [patched in Bazel](bazelbuild/bazel#10493). In the meantime, we can revert these two commits in protobuf ([first](protocolbuffers/protobuf@7b28278), [second](protocolbuffers/protobuf@a03d332)) and apply the diff as a patch until we're able to update Bazel with the fix. More context on the protobuf issue is available [here](protocolbuffers/protobuf#7046).

Notes:
- This should be reverted after updating Bazel with the fix
- The version of protobuf specified in the `http_archive` should be in lockstep with upstream Envoy's version
- Upstream Envoy's `@envoy//bazel:protobuf.patch` patch is also included here

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this issue Nov 29, 2022
Fixes envoyproxy/envoy-mobile#617, which resulted in duplicate symbols from protobuf being present in the final Envoy Mobile binary.

The [root cause](bazelbuild/bazel#10484) is being [patched in Bazel](bazelbuild/bazel#10493). In the meantime, we can revert these two commits in protobuf ([first](protocolbuffers/protobuf@7b28278), [second](protocolbuffers/protobuf@a03d332)) and apply the diff as a patch until we're able to update Bazel with the fix. More context on the protobuf issue is available [here](protocolbuffers/protobuf#7046).

Notes:
- This should be reverted after updating Bazel with the fix
- The version of protobuf specified in the `http_archive` should be in lockstep with upstream Envoy's version
- Upstream Envoy's `@envoy//bazel:protobuf.patch` patch is also included here

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build core no stalebot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants