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

2.6.1 test segfault on arm #298

Closed
opoplawski opened this issue Apr 22, 2015 · 3 comments
Closed

2.6.1 test segfault on arm #298

opoplawski opened this issue Apr 22, 2015 · 3 comments

Comments

@opoplawski
Copy link

Trying to build the Fedora protobuf 2.6.1 package, test is failing on arm only. Valgrind reports:


[ RUN      ] ExtensionSetTest.RepeatedFields
==25250== Invalid read of size 4
==25250==    at 0x148C94: GetRepeated (extension_set.h:768)
==25250==    by 0x148C94: GetRepeatedExtension<google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long int>, 18u, false> (unittest.pb.h:1813)
==25250==    by 0x148C94: long long google::protobuf::internal::(anonymous namespace)::SumAllExtensions<long long, protobuf_unittest::TestAllExtensions, google::protobuf::internal::ExtensionIdentifier<protobuf_unittest::TestAllExtensions, google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long>, (unsigned char)18, false> >(protobuf_unittest::TestAllExtensions const&, google::protobuf::internal::ExtensionIdentifier<protobuf_unittest::TestAllExtensions, google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long>, (unsigned char)18, false>, long long) [clone .isra.129] [clone .constprop.318] (extension_set_unittest.cc:679)
==25250==    by 0x20D17B: google::protobuf::internal::(anonymous namespace)::ExtensionSetTest_RepeatedFields_Test::TestBody() (extension_set_unittest.cc:748)
==25250==    by 0x4AAB66B: HandleSehExceptionsInMethodIfSupported<testing::Test, void> (gtest.cc:1996)
==25250==    by 0x4AAB66B: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2032)
==25250==    by 0x4AA397B: testing::Test::Run() (gtest.cc:2068)
==25250==    by 0x4AA3B03: testing::TestInfo::Run() (gtest.cc:2244)
==25250==    by 0x4AA3BEF: testing::TestCase::Run() (gtest.cc:2351)
==25250==    by 0x4AA4767: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:4177)
==25250==    by 0x4AA4AEF: HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (gtest.cc:1996)
==25250==    by 0x4AA4AEF: HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (gtest.cc:2032)
==25250==    by 0x4AA4AEF: testing::UnitTest::Run() (gtest.cc:3809)
==25250==    by 0x4AC5733: main (gtest_main.cc:37)
==25250==  Address 0x20 is not stack'd, malloc'd or (recently) free'd
==25250==
==25250==
==25250== Process terminating with default action of signal 11 (SIGSEGV)

gdb reports a corrupted stack, so it may not be very useful:

Program received signal SIGSEGV, Segmentation fault.
0x2a040c94 in GetRepeated (set=..., number=<optimized out>)
    at ./google/protobuf/extension_set.h:768
768     PROTOBUF_DEFINE_PRIMITIVE_TYPE( int64,  Int64)
(gdb) list
763       return reinterpret_cast<RepeatedField<TYPE>*>(                           \
764           set->MutableRawRepeatedField(number, field_type, is_packed, NULL));  \
765     }
766
767     PROTOBUF_DEFINE_PRIMITIVE_TYPE( int32,  Int32)
768     PROTOBUF_DEFINE_PRIMITIVE_TYPE( int64,  Int64)
769     PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint32, UInt32)
770     PROTOBUF_DEFINE_PRIMITIVE_TYPE(uint64, UInt64)
771     PROTOBUF_DEFINE_PRIMITIVE_TYPE( float,  Float)
772     PROTOBUF_DEFINE_PRIMITIVE_TYPE(double, Double)
(gdb) bt
#0  0x2a040c94 in GetRepeated (set=..., number=<optimized out>)
    at ./google/protobuf/extension_set.h:768
#1  GetRepeatedExtension<google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long>, 18u, false> (id=..., this=0xbefff42c) at ./google/protobuf/unittest.pb.h:1813
#2  google::protobuf::internal::(anonymous namespace)::SumAllExtensions<long long, protobuf_unittest::TestAllExtensions, google::protobuf::internal::ExtensionIdentifier<protobuf_unittest::TestAllExtensions, google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long>, 18u, false> > (message=..., zero=0, extension=...)
    at google/protobuf/extension_set_unittest.cc:679
#3  0x2a10517c in google::protobuf::internal::(anonymous namespace)::ExtensionSetTest_RepeatedFields_Test::TestBody (this=<optimized out>)
    at google/protobuf/extension_set_unittest.cc:748
#4  0xb6d9966c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) up
#1  GetRepeatedExtension<google::protobuf::internal::RepeatedPrimitiveTypeTraits<long long>, 18u, false> (id=..., this=0xbefff42c) at ./google/protobuf/unittest.pb.h:1813
1813      GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TestAllExtensions)
(gdb) print *this
$4 = {<google::protobuf::Message> = {<No data fields>}, _extensions_ = {extensions_ = {
      _M_t = {
        _M_impl = {<std::allocator<std::_Rb_tree_node<std::pair<int const, google::protobuf::internal::ExtensionSet::Extension> > >> = {<__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, google::protobuf::internal::ExtensionSet::Extension> > >> = {<No data fields>}, <No data fields>},
          _M_key_compare = {<std::binary_function<int, int, bool>> = {<No data fields>}, <No data fields>}, _M_header = {_M_color = std::_S_red, _M_parent = 0x2a586c28,
            _M_left = 0x2a514d38, _M_right = 0x2a5146e8}, _M_node_count = 17}}}},
  _unknown_fields_ = {fields_ = 0x0}, _has_bits_ = {0}, _cached_size_ = 0,
  static default_instance_ = 0x2a50d2c8}

Any ideas?

@alphaonex86
Copy link

Same here, under grsec/PaX:
[511438.529097] PAX: From 192.168.158.10: execution attempt in: (null), 00000000-00000000 00000000
[511438.530870] PAX: terminating task: /var/tmp/portage/dev-libs/protobuf-2.6.1-r3/work/protobuf-2.6.1-.arm/src/.libs/lt-protoc(lt-protoc):615, uid/euid: 250/250, PC: ffff0fc0, SP: b55b97b0
[511438.546024] PAX: bytes at PC: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??
[511438.546058] PAX: bytes at SP-4: 00000000 0000000c 9f3dbe00 b55b9844 9f808b28 9fbdbec0 9f80a0c0 b55b97e0 b55b988c 9fbdc908 9f72b3c8 b55b9844 9f72bfc0 9f807558 9f72a77c 00000000 9f3dbe00 b55b9844 9f8073d0 9f8073e8 00000011
[511438.546134] grsec: From 192.168.158.10: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/tmp/portage/dev-libs/protobuf-2.6.1-r3/work/protobuf-2.6.1-.arm/src/.libs/lt-protoc[lt-protoc:615] uid/euid:250/250 gid/egid:250/250, parent /bin/bash[sh:614] uid/euid:250/250 gid/egid:250/250

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jan 20, 2016

Could you help test if the latest version 3.0.0b2 still has the problem?

@opoplawski
Copy link
Author

Actually, it appears that we are no longer seeing this failure on the arm builders with 2.6.1 any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants