protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

clang 3.7.0 memory sanitizer - uninitialized value

Open mintyc opened this issue 11 years ago • 1 comments

using clang 3.7.0 with gcc 4.8.3's stdlibc++ on Centos 7 with 3.0.0-beta-1 export CXXFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer" then build and run tests Gives a traced Warning of use of uninitialized value...

StaticDescriptorInitializer_google_2fprotobuf_2fany_2eproto constructor() calls AddDesc... stack down to SimpleDescriptorDatabase::DescriptorIndex<>AddFile() - this function has comments to read.... in descriptor_database.cc
// We must be careful here -- calling file.package() if file.has_package() is // false could access an uninitialized static-storage variable if we are being // run at startup time.

uininitialized value reported down through AddSymbol() to ValidateSymbolName()

Sanitizer stops at the first problem, so there may be others.

mintyc avatar Oct 26 '15 18:10 mintyc

According to https://github.com/google/protobuf/issues/1099 protobuf is msan-clean, and errors are likely due to a misbuilt/misconfigured libstdc++. I also just ran msan against our protobuf test suite internally and it was clean.

haberman avatar Mar 16 '17 00:03 haberman