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

Failing to build 2.6.1 on cygwin #631

Closed
rossengeorgiev opened this issue Jul 21, 2015 · 4 comments
Closed

Failing to build 2.6.1 on cygwin #631

rossengeorgiev opened this issue Jul 21, 2015 · 4 comments
Assignees

Comments

@rossengeorgiev
Copy link

Here is the output from make

libtool: link: ranlib .libs/libprotoc.a
libtool: link: ( cd ".libs" && rm -f "libprotoc.la" && ln -s "../libprotoc.la" "libprotoc.la" )
/bin/sh ../libtool  --tag=CXX   --mode=link g++  -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG   -o protoc.exe google/protobuf/compiler/main.o  libprotobuf.la libprotoc.la -lz
libtool: link: g++ -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -o .libs/protoc.exe google/protobuf/compiler/main.o  ./.libs/libprotobuf.dll.a ./.libs/libprotoc.dll.a /home/user/protobuf/protobuf-2.6.1/src/.libs/libprotobuf.dll.a -lz -L/usr/local/lib
oldpwd=`pwd` && ( cd . && $oldpwd/protoc.exe -I. --cpp_out=$oldpwd google/protobuf/unittest.proto google/protobuf/unittest_empty.proto google/protobuf/unittest_import.proto google/protobuf/unittest_import_public.proto google/protobuf/unittest_mset.proto google/protobuf/unittest_optimize_for.proto google/protobuf/unittest_embed_optimize_for.proto google/protobuf/unittest_custom_options.proto google/protobuf/unittest_lite.proto google/protobuf/unittest_import_lite.proto google/protobuf/unittest_import_public_lite.proto google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_no_generic_services.proto google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto )
Makefile:3635: recipe for target 'unittest_proto_middleman' failed
make[2]: *** [unittest_proto_middleman] Error 127
@xfxyjwf
Copy link
Contributor

xfxyjwf commented Jan 21, 2016

Could you try the latest 3.0.0b2 version?

@rossengeorgiev
Copy link
Author

@xfxyjwf, 3.0.0b2 compiles.

$ uname -sorvm
CYGWIN_NT-10.0 2.2.0(0.289/5/3) 2015-08-03 12:51 x86_64 Cygwin
$ ./src/protoc.exe --version
libprotoc 3.0.0

However, make check fails.

../test-driver: line 107:  8076 Segmentation fault      (core dumped) "$@" > $log_file 2>&1
FAIL: protobuf-test.exe
PASS: protobuf-lazy-descriptor-test.exe
PASS: protobuf-lite-test.exe
PASS: google/protobuf/compiler/zip_output_unittest.sh
PASS: google/protobuf/io/gzip_stream_unittest.sh
PASS: protobuf-lite-arena-test.exe

@opoplawski
Copy link

opoplawski commented Nov 4, 2016

We're seeing what I think is this same error on Fedora Rawhide with 3.1.0. gdb shows:

Core was generated by `/builddir/build/BUILD/protobuf-3.1.0/src/.libs/lt-protobuf-test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  testing::internal::ActionResultHolder<void>::GetValueAndDelete (this=0x0)
    at ./../gmock/include/gmock/gmock-spec-builders.h:1373
1373      void GetValueAndDelete() const { delete this; }
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.24.90-13.fc26.x86_64 libgcc-6.2.1-2.fc26.x86_64 libstdc++-6.2.1-2.fc26.x86_64 zlib-1.2.8-10.fc24.x86_64
(gdb) print this
$1 = (const testing::internal::ActionResultHolder<void> * const) 0x0
(gdb) up
#1  testing::internal::FunctionMockerBase<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>::InvokeWith(std::tuple<google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece> const&) (args=std::tuple containing = {...}, this=
    0x7f4c592beb10) at ./../gmock/include/gmock/gmock-spec-builders.h:1530
1530            this->UntypedInvokeWith(&args))->GetValueAndDelete();
(gdb) print *this
warning: RTTI symbol not found for class 'testing::internal::FunctionMocker<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>'
$2 = warning: RTTI symbol not found for class 'testing::internal::FunctionMocker<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>'
{<testing::internal::UntypedFunctionMockerBase> = {
    _vptr.UntypedFunctionMockerBase = 0x7f4c58756638 <vtable for testing::internal::FunctionMocker<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>+16>, mock_obj_ = 0x7f4c592bea70, 
    name_ = 0x7f4c581e9a68 "InvalidValue", 
    untyped_on_call_specs_ = std::vector of length 0, capacity 0, 
    untyped_expectations_ = std::vector of length 4, capacity 4 = {{value_ = 0x7f4c592c5060, 
        link_ = {next_ = 0x7f4c5941a8d8}}, {value_ = 0x7f4c592bee90, link_ = {
          next_ = 0x7f4c5941a8e8}}, {value_ = 0x7f4c592c5240, link_ = {
          next_ = 0x7f4c5941a8f8}}, {value_ = 0x7f4c592c5420, link_ = {
          next_ = 0x7f4c5941a908}}}}, current_spec_ = {function_mocker_ = 0x7f4c592beb10, 
    matchers_ = std::tuple containing = {
      [1] = {<testing::internal::MatcherBase<google::protobuf::util::converter::LocationTrackerInterface const&>> = {
          _vptr.MatcherBase = 0x7f4c587565c8 <vtable for testing::Matcher<google::protobuf::util::converter::LocationTrackerInterface const&>+16>, impl_ = {value_ = 0x7f4c592baaa0, link_ = {
              next_ = 0x7f4c592c5550}}}, <No data fields>}, 
      [2] = {<testing::internal::MatcherBase<google::protobuf::StringPiece>> = {
          _vptr.MatcherBase = 0x7f4c58752038 <vtable for testing::Matcher<google::protobuf::StringPiece>+16>, impl_ = {value_ = 0x7f4c593ea5e0, link_ = {
              next_ = 0x7f4c592c5538}}}, <No data fields>}, 
      [3] = {<testing::internal::MatcherBase<google::protobuf::StringPiece>> = {
          _vptr.MatcherBase = 0x7f4c58752038 <vtable for testing::Matcher<google::protobuf::StringPiece>+16>, impl_ = {value_ = 0x7f4c592bed20, link_ = {
              next_ = 0x7f4c592c5520}}}, <No data fields>}}}}
(gdb) print args
$3 = std::tuple containing = {[1] = warning: RTTI symbol not found for class 'google::protobuf::util::converter::ProtoWriter::ProtoElement'
@0x7f4c592c5ea8, [2] = {
    ptr_ = 0x7f4c593f7ac0 "TYPE_INT32", length_ = 10, static npos = 18446744073709551615},
  [3] = {ptr_ = 0x7ffd448693f8 "\"Infinity\"", length_ = 10,
    static npos = 18446744073709551615}}
(gdb) bt
#0  testing::internal::ActionResultHolder<void>::GetValueAndDelete (this=0x0)
    at ./../gmock/include/gmock/gmock-spec-builders.h:1373
#1  testing::internal::FunctionMockerBase<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>::InvokeWith(std::tuple<google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece> const&) (args=std::tuple containing = {...},
    this=0x7f4c592beb10) at ./../gmock/include/gmock/gmock-spec-builders.h:1530
#2  testing::internal::FunctionMocker<void (google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece)>::Invoke(google::protobuf::util::converter::LocationTrackerInterface const&, google::protobuf::StringPiece, google::protobuf::StringPiece) (a3=..., a2=..., a1=warning: RTTI symbol not found for class 'google::protobuf::util::converter::ProtoWriter::ProtoElement'
..., this=0x7f4c592beb10)
    at ./../gmock/include/gmock/gmock-generated-function-mockers.h:140
#3  google::protobuf::util::converter::MockErrorListener::InvalidValue (this=0x7f4c592bea70,
    gmock_a1=..., gmock_a2=..., gmock_a3=...)
    at ./google/protobuf/util/internal/mock_error_listener.h:52
#4  0x00007f4c570ddc6d in google::protobuf::util::converter::ProtoWriter::RenderPrimitiveField
    (this=this@entry=0x7f4c592c4c40, field=..., type=..., data=...)
    at google/protobuf/util/internal/proto_writer.cc:681
#5  0x00007f4c570decec in google::protobuf::util::converter::ProtoWriter::RenderDataPiece (
    this=this@entry=0x7f4c592c4c40, name=..., data=...)
    at google/protobuf/util/internal/proto_writer.cc:537
#6  0x00007f4c570dac4c in google::protobuf::util::converter::ProtoStreamObjectWriter::RenderDataPiece (this=0x7f4c592c4c40, name=..., data=...)
    at google/protobuf/util/internal/protostream_objectwriter.cc:1122
#7  0x00007f4c570db20e in google::protobuf::util::converter::ProtoWriter::RenderString (
    this=this@entry=0x7f4c592c4c40, name=..., value=...)
    at ./google/protobuf/util/internal/proto_writer.h:111
#8  0x00007f4c57b1e2ec in google::protobuf::util::converter::ProtoStreamObjectWriterTest_InfinityInputTest_Test::TestBody (this=0x7f4c592bea40)
    at google/protobuf/util/internal/protostream_objectwriter_test.cc:476
#9  0x00007f4c566674f4 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (location=0x7f4c5666950e "the test body", method=<optimized out>,
    object=<optimized out>) at ./src/gtest.cc:2078
#10 testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (
    object=object@entry=0x7f4c592bea40, method=<optimized out>,
    location=location@entry=0x7f4c5666950e "the test body") at ./src/gtest.cc:2114
#11 0x00007f4c5665f3ba in testing::Test::Run (this=0x7f4c592bea40) at ./src/gtest.cc:2151
#12 0x00007f4c5665f508 in testing::TestInfo::Run (this=0x7f4c59104440) at ./src/gtest.cc:2326
#13 0x00007f4c5665f5e5 in testing::TestCase::Run (this=0x7f4c59103630) at ./src/gtest.cc:2444
#14 0x00007f4c5665f8b7 in testing::internal::UnitTestImpl::RunAllTests (this=0x7f4c58fd8ef0)
    at ./src/gtest.cc:4315
#15 0x00007f4c566679a4 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (
    location=0x7f4c56668a78 "auxiliary test code (environments or event listeners)",
    method=<optimized out>, object=<optimized out>) at ./src/gtest.cc:2078
#16 testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x7f4c58fd8ef0, method=<optimized out>,
    location=location@entry=0x7f4c56668a78 "auxiliary test code (environments or event listeners)") at ./src/gtest.cc:2114
#17 0x00007f4c5665fbc0 in testing::UnitTest::Run (
    this=0x7f4c56877260 <testing::UnitTest::GetInstance()::instance>) at ./src/gtest.cc:3926
#18 0x00007f4c5620c8c9 in RUN_ALL_TESTS () at ./gtest/include/gtest/gtest.h:2288
#19 main (argc=<optimized out>, argv=0x7ffd4486a538) at src/gmock_main.cc:53
#20 0x00007f4c553a1451 in __libc_start_main () from /lib64/libc.so.6
#21 0x00007f4c57747e5a in _start ()

@xfxyjwf xfxyjwf self-assigned this Nov 4, 2016
@jjhelmus
Copy link

I've run into a similar segmentation fault when build protobuf 3.4.1 with a custom GCC 7.2.0. Removing a -O2 optimization flag from CXXFLAGS fixed the segmentation fault. Setting the same optimization flag in the PROTOBUF_OPT_FLAG variable did not effect the test suite.

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

4 participants