-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Explicitly specify pyext/cpp_message.py in py_modules list #3
Conversation
I'm not sure whether this is the right change. My understanding is that cpp_message.py is only used for Python CPPv1. We probably should delete it instead. |
There are 2 implementations of There's a second implementation in Without specifying |
Explicitly specify pyext/cpp_message.py in py_modules list
This should fixes issue #34 |
Provide UT that reproduces issue protocolbuffers#3
==500166==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xdd383e in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:504:7 #1 0xdd1eb2 in google::protobuf::compiler::DiskSourceTree::DiskFileToVirtualFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:431:51 #2 0x540619 in google::protobuf::compiler::CommandLineInterface::MakeProtoProtoPathRelative(google::protobuf::compiler::DiskSourceTree*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1362:24 #3 0x5314fb in google::protobuf::compiler::CommandLineInterface::MakeInputsBeProtoPathRelative(google::protobuf::compiler::DiskSourceTree*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1415:10 #4 0x5314fb in google::protobuf::compiler::CommandLineInterface::InitializeDiskSourceTree(google::protobuf::compiler::DiskSourceTree*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1168:8 #5 0x52541f in google::protobuf::compiler::CommandLineInterface::Run(int, char const* const*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1026:10 protocolbuffers#6 0x50f5d6 in google::protobuf::compiler::ProtobufMain(int, char**) build_msan/./contrib/protobuf/src/google/protobuf/compiler/main.cc:104:14 protocolbuffers#7 0x50fe58 in main build_msan/./contrib/protobuf/src/google/protobuf/compiler/main.cc:112:10 protocolbuffers#8 0x7f817143db24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) protocolbuffers#9 0x48904d in _start (/mnt/ch/ClickHouse/build_msan/contrib/protobuf-cmake/protoc+0x48904d) Uninitialized value was created by an allocation of 'sb' in the stack frame of function '_ZN6google8protobuf8compiler14DiskSourceTree12OpenDiskFileERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE' #0 0xdd3320 in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:492 SUMMARY: MemorySanitizer: use-of-uninitialized-value build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:504:7 in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Exiting
We would like for upb_Map_Delete() to optionally return the deleted value. Unfortunately this will require several steps since we are crossing repos. Step protocolbuffers#3: Give the new footprint to the original function and switch back to it. Since we're already touching map.h, also mark UPB_API as appropriate. PiperOrigin-RevId: 498398474
This fixes an MSAN warning of the form: ``` WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x7fc964f2a597 in arena_findroot third_party/upb/upb/mem/arena.c:64:3 #1 0x7fc964f2a597 in upb_Arena_Free third_party/upb/upb/mem/arena.c:211:7 protocolbuffers#2 0x7fc9d2af0028 in std::__msan::unique_ptr<upb_Arena, void (*)(upb_Arena*)>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:277:7 protocolbuffers#3 0x7fc9d2aef7a2 in ~Arena third_party/upb/upb/upb.hpp:70:7 protocolbuffers#4 0x7fc9d2aef7a2 in ~InlinedArena third_party/upb/upb/upb.hpp:97:7 protocolbuffers#5 0x7fc9d2aef7a2 in Cpp_InlinedArena2_Test::TestBody() third_party/upb/upb/test/test_cpp.cc:187:1 protocolbuffers#6 0x7fc97da78a57 in testing::Test::Run() third_party/googletest/googletest/src/gtest.cc:2695:5 protocolbuffers#7 0x7fc97da7a3e8 in testing::TestInfo::Run() third_party/googletest/googletest/src/gtest.cc:2844:11 protocolbuffers#8 0x7fc97da7b897 in testing::TestSuite::Run() third_party/googletest/googletest/src/gtest.cc:3003:30 protocolbuffers#9 0x7fc97daa5136 in testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/googletest/src/gtest.cc:5899:44 protocolbuffers#10 0x7fc97daa455c in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/googletest/src/gtest.cc protocolbuffers#11 0x7fc97daa455c in testing::UnitTest::Run() third_party/googletest/googletest/src/gtest.cc:5464:10 protocolbuffers#12 0x562a7fb876f0 in RUN_ALL_TESTS third_party/googletest/googletest/include/gtest/gtest.h:2329:73 protocolbuffers#13 0x562a7fb876f0 in main testing/base/internal/gunit_main.cc:86:10 protocolbuffers#14 0x7fc9ba9b7632 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x61632) (BuildId: 280088eab084c30a3992a9bce5c35b44) protocolbuffers#15 0x562a7fafdbe9 in _start /build/work/ab393f4ac612f9027aae6b1a7226027ba2a2/google3/blaze-out/k8-opt/bin/third_party/grte/v5_src/grte-scratch/BUILD/src/csu/../sysdeps/x86_64/start.S:120 Member fields were destroyed #0 0x562a7fb0b13d in __sanitizer_dtor_callback_fields third_party/llvm/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:960:5 #1 0x7fc9d2aef79a in ~InlinedArena third_party/upb/upb/upb.hpp:105:8 protocolbuffers#2 0x7fc9d2aef79a in ~InlinedArena third_party/upb/upb/upb.hpp:97:7 protocolbuffers#3 0x7fc9d2aef79a in Cpp_InlinedArena2_Test::TestBody() third_party/upb/upb/test/test_cpp.cc:187:1 protocolbuffers#4 0x7fc97da78a57 in testing::Test::Run() third_party/googletest/googletest/src/gtest.cc:2695:5 protocolbuffers#5 0x7fc97da7a3e8 in testing::TestInfo::Run() third_party/googletest/googletest/src/gtest.cc:2844:11 protocolbuffers#6 0x7fc97da7b897 in testing::TestSuite::Run() third_party/googletest/googletest/src/gtest.cc:3003:30 protocolbuffers#7 0x7fc97daa5136 in testing::internal::UnitTestImpl::RunAllTests() third_party/googletest/googletest/src/gtest.cc:5899:44 protocolbuffers#8 0x7fc97daa455c in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> third_party/googletest/googletest/src/gtest.cc protocolbuffers#9 0x7fc97daa455c in testing::UnitTest::Run() third_party/googletest/googletest/src/gtest.cc:5464:10 protocolbuffers#10 0x562a7fb876f0 in RUN_ALL_TESTS third_party/googletest/googletest/include/gtest/gtest.h:2329:73 protocolbuffers#11 0x562a7fb876f0 in main testing/base/internal/gunit_main.cc:86:10 protocolbuffers#12 0x7fc9ba9b7632 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x61632) (BuildId: 280088eab084c30a3992a9bce5c35b44) protocolbuffers#13 0x562a7fafdbe9 in _start /build/work/ab393f4ac612f9027aae6b1a7226027ba2a2/google3/blaze-out/k8-opt/bin/third_party/grte/v5_src/grte-scratch/BUILD/src/csu/../sysdeps/x86_64/start.S:120 ``` PiperOrigin-RevId: 511849224
PiperOrigin-RevId: 573295697
PiperOrigin-RevId: 573295697
PiperOrigin-RevId: 573556031
==500166==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0xdd383e in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:504:7 #1 0xdd1eb2 in google::protobuf::compiler::DiskSourceTree::DiskFileToVirtualFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:431:51 #2 0x540619 in google::protobuf::compiler::CommandLineInterface::MakeProtoProtoPathRelative(google::protobuf::compiler::DiskSourceTree*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1362:24 #3 0x5314fb in google::protobuf::compiler::CommandLineInterface::MakeInputsBeProtoPathRelative(google::protobuf::compiler::DiskSourceTree*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1415:10 #4 0x5314fb in google::protobuf::compiler::CommandLineInterface::InitializeDiskSourceTree(google::protobuf::compiler::DiskSourceTree*, google::protobuf::DescriptorDatabase*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1168:8 #5 0x52541f in google::protobuf::compiler::CommandLineInterface::Run(int, char const* const*) build_msan/./contrib/protobuf/src/google/protobuf/compiler/command_line_interface.cc:1026:10 protocolbuffers#6 0x50f5d6 in google::protobuf::compiler::ProtobufMain(int, char**) build_msan/./contrib/protobuf/src/google/protobuf/compiler/main.cc:104:14 protocolbuffers#7 0x50fe58 in main build_msan/./contrib/protobuf/src/google/protobuf/compiler/main.cc:112:10 protocolbuffers#8 0x7f817143db24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24) protocolbuffers#9 0x48904d in _start (/mnt/ch/ClickHouse/build_msan/contrib/protobuf-cmake/protoc+0x48904d) Uninitialized value was created by an allocation of 'sb' in the stack frame of function '_ZN6google8protobuf8compiler14DiskSourceTree12OpenDiskFileERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE' #0 0xdd3320 in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:492 SUMMARY: MemorySanitizer: use-of-uninitialized-value build_msan/./contrib/protobuf/src/google/protobuf/compiler/importer.cc:504:7 in google::protobuf::compiler::DiskSourceTree::OpenDiskFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Exiting
``` int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [24 bytes] 0x000024d0 mov w0, #0x160 0x000024d4 clz w1, w1 0x000024d8 add w1, w1, w1, lsl #3 0x000024dc sub w0, w0, w1 0x000024e0 lsr w0, w0, #6 0x000024e4 ret ``` versus existing: ``` int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [72 bytes] 0x000022a0 and w0, w1, #0xffffff80 0x000022a4 cbnz w0, #+0xc (addr 0x22b0) 0x000022a8 mov w0, #0x1 0x000022ac b #+0x38 (addr 0x22e4) 0x000022b0 and w0, w1, #0xffffc000 0x000022b4 cbnz w0, #+0xc (addr 0x22c0) 0x000022b8 mov w0, #0x2 0x000022bc b #+0x28 (addr 0x22e4) 0x000022c0 and w0, w1, #0xffe00000 0x000022c4 cbnz w0, #+0xc (addr 0x22d0) 0x000022c8 mov w0, #0x3 0x000022cc b #+0x18 (addr 0x22e4) 0x000022d0 mov w2, #0x5 0x000022d4 mov w0, #0x4 0x000022d8 and w1, w1, #0xf0000000 0x000022dc cmp w1, #0x0 (0) 0x000022e0 csel w0, w2, w0, ne 0x000022e4 ret ``` PiperOrigin-RevId: 584143825
``` int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [24 bytes] 0x000024d0 mov w0, #0x160 0x000024d4 clz w1, w1 0x000024d8 add w1, w1, w1, lsl #3 0x000024dc sub w0, w0, w1 0x000024e0 lsr w0, w0, #6 0x000024e4 ret ``` versus existing: ``` int com.google.android.test.Outer.computeUInt32SizeNoTag(int) [72 bytes] 0x000022a0 and w0, w1, #0xffffff80 0x000022a4 cbnz w0, #+0xc (addr 0x22b0) 0x000022a8 mov w0, #0x1 0x000022ac b #+0x38 (addr 0x22e4) 0x000022b0 and w0, w1, #0xffffc000 0x000022b4 cbnz w0, #+0xc (addr 0x22c0) 0x000022b8 mov w0, #0x2 0x000022bc b #+0x28 (addr 0x22e4) 0x000022c0 and w0, w1, #0xffe00000 0x000022c4 cbnz w0, #+0xc (addr 0x22d0) 0x000022c8 mov w0, #0x3 0x000022cc b #+0x18 (addr 0x22e4) 0x000022d0 mov w2, #0x5 0x000022d4 mov w0, #0x4 0x000022d8 and w1, w1, #0xf0000000 0x000022dc cmp w1, #0x0 (0) 0x000022e0 csel w0, w2, w0, ne 0x000022e4 ret ``` PiperOrigin-RevId: 591113652
…ted_headers Update list of headers
…take #3) PiperOrigin-RevId: 673536874
…take #3 but disabled) PiperOrigin-RevId: 673536874
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675266565
…take #3 but disabled) PiperOrigin-RevId: 675319986
No description provided.