Skip to content

bazel: fix protobuf UBSAN errors#2452

Merged
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
brian-pane:ubsan-fix
Jan 25, 2018
Merged

bazel: fix protobuf UBSAN errors#2452
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
brian-pane:ubsan-fix

Conversation

@brian-pane
Copy link
Copy Markdown
Contributor

Description:
The google-protobuf library, by default, uses unaligned reads on x86.
Those happen to work on that CPU architecture, but their behavior is
undefined in C/C++, so UBSAN (which runs along with ASAN in the CI
ASAN tests) treats them as an error.

Defining ADDRESS_SANITIZER=1 causes the protobuf library to use
a portable alternative to the unaligned reads.

Risk Level: Low

Testing: I tested this change with PR 2429, where it fixed the ASAN test failure.

Docs Changes: N/A

Release Notes: N/A

Signed-off-by: Brian Pane bpane@pinterest.com

*Description*:
The google-protobuf library, by default, uses unaligned reads on x86.
Those happen to work on that CPU architecture, but their behavior is
undefined in C/C++, so UBSAN (which runs along with ASAN in the CI
ASAN tests) treats them as an error.

Defining `ADDRESS_SANITIZER=1` causes the protobuf library to use
a portable alternative to the unaligned reads.

Signed-off-by: Brian Pane <bpane@pinterest.com>

*Risk Level*: Low

*Testing*: I tested this change with PR [2429](#2429),
where it fixed the ASAN test failure.

*Docs Changes*: N/A

*Release Notes*: N/A
@mattklein123 mattklein123 merged commit 15afb90 into envoyproxy:master Jan 25, 2018
@brian-pane brian-pane deleted the ubsan-fix branch January 25, 2018 21:59
Shikugawa pushed a commit to Shikugawa/envoy that referenced this pull request Mar 28, 2020
envoyproxy#2452)

* Use FilterState instead  of  DynamicMetadata  in  Metadata Exchange  Plugin

Also made  the plugin  in sync with existing HTTP Metadata Exchange Wasm Plugin,  so that stats(prometheus)  plugin  can use this easily.

Fixed based on feedback

* Fix  build errors
jpsim added a commit that referenced this pull request Nov 28, 2022
Continued from #2441.

Description: Parallels Android implementation based on SharedPreferences.
Risk Level: Low
Testing: Application

Co-authored-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim added a commit that referenced this pull request Nov 29, 2022
Continued from #2441.

Description: Parallels Android implementation based on SharedPreferences.
Risk Level: Low
Testing: Application

Co-authored-by: Mike Schore <mike.schore@gmail.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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants