You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of protobuf and what language are you using?
Version: main/v3.6.0/v3.5.0 etc. (NOTE: please try updating to the latest version of protoc/runtime possible beforehand to attempt to resolve your problem)
Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
What operating system (Linux, Windows, ...) and version?
[bob@bob-systemproductname ~]$ uname -a
Linux bob-systemproductname 5.15.89-1-MANJARO #1 SMP PREEMPT Wed Jan 18 20:37:11 UTC 2023 x86_64 GNU/Linux
[bob@bob-systemproductname ~]$
Manjaro here has been given a full system update as of yesterday
What runtime / compiler are you using (e.g., python version or gcc version)
[bob@bob-systemproductname dependencies]$ gcc --version
gcc (GCC) 12.2.1 20230111
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[bob@bob-systemproductname dependencies]$ llvm --version
bash: llvm: command not found
[bob@bob-systemproductname dependencies]$ clang --version
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
[bob@bob-systemproductname dependencies]$ python --version
Python 3.10.9
[bob@bob-systemproductname dependencies]$
What did you do?
Steps to reproduce the behavior:
Go to the bazel root build directory
Try to build the protobuf_python target using the bazel command
bazel-out/k8-opt-exec-2B5CBBC6/bin/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/map.h:1014:32: error: 'unsigned-integer-overflow' attribute directive ignored [-Werror=attributes]
1014 | BucketNumber(const K& k) const {
| ^~~~~
cc1plus: all warnings being treated as errors
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
Triaging the issue
In the file, protobuf/src/google/protobuf/map.h
// size_type PROTOBUF_NO_SANITIZE("unsigned-integer-overflow")
uint64_t BucketNumber(const K& k) const {
// We xor the hash value against the random seed so that we effectively
// have a random hash function.
uint64_t h = hash_function()(k) ^ seed_;
// We use the multiplication method to determine the bucket number from
// the hash value. The constant kPhi (suggested by Knuth) is roughly
// (sqrt(5) - 1) / 2 * 2^64.
constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15};
return ((kPhi * h) >> 32) & (num_buckets_ - 1);
}
Here, when we allow integer sanitization, and provide a return type of uint64_t, the build succeeds.
The text was updated successfully, but these errors were encountered:
What version of protobuf and what language are you using?
Version: main/v3.6.0/v3.5.0 etc. (NOTE: please try updating to the latest version of protoc/runtime possible beforehand to attempt to resolve your problem)
Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
What operating system (Linux, Windows, ...) and version?
Manjaro here has been given a full system update as of yesterday
What runtime / compiler are you using (e.g., python version or gcc version)
What did you do?
Steps to reproduce the behavior:
(The entire log is attached here
What did you expect to see
Build completed successfully without errors.
What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
Triaging the issue
In the file, protobuf/src/google/protobuf/map.h
Here, when we allow integer sanitization, and provide a return type of uint64_t, the build succeeds.
The text was updated successfully, but these errors were encountered: