[ 
https://issues.apache.org/jira/browse/MESOS-9755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878791#comment-16878791
 ] 

Benjamin Mahler commented on MESOS-9755:
----------------------------------------

Note that upgrading protobuf to 3.7.x breaks the grpc build in the mesos 
autotools build:

{noformat}
[HOSTCXX] Compiling src/compiler/cpp_plugin.cc
[HOSTCXX] Compiling src/compiler/node_plugin.cc
[HOSTCXX] Compiling src/compiler/csharp_plugin.cc
[HOSTCXX] Compiling src/compiler/php_plugin.cc
[HOSTCXX] Compiling src/compiler/objective_c_plugin.cc
[HOSTCXX] Compiling src/compiler/python_plugin.cc
[HOSTCXX] Compiling src/compiler/ruby_plugin.cc
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_python_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_csharp_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_objective_c_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_ruby_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_node_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_php_plugin
[HOSTLD]  Linking 
/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/bins/opt/grpc_cpp_plugin
[PROTOC]  Generating protobuf CC file from src/proto/grpc/health/v1/health.proto
[PROTOC]  Generating protobuf CC file from 
src/proto/grpc/testing/echo_messages.proto
[PROTOC]  Generating protobuf CC file from src/proto/grpc/testing/payloads.proto
[PROTOC]  Generating protobuf CC file from src/proto/grpc/core/stats.proto
[PROTOC]  Generating protobuf CC file from src/proto/grpc/testing/messages.proto
third_party/protobuf/src: warning: directory does not exist.
third_party/protobuf/srcthird_party/protobuf/src: warning: directory does not 
exist.: warning: directory does not exist.

third_party/protobuf/src: warning: directory does not exist.
third_party/protobuf/src: warning: directory does not exist.
[GRPC]    Generating gRPC's protobuf service CC file from 
src/proto/grpc/health/v1/health.proto
[GRPC]    Generating gRPC's protobuf service CC file from 
src/proto/grpc/testing/payloads.proto
[GRPC]    Generating gRPC's protobuf service CC file from 
src/proto/grpc/core/stats.proto
third_party/protobuf/src: warning: directory does not exist.
[GRPC]    Generating gRPC's protobuf service CC file from 
src/proto/grpc/testing/echo_messages.proto
[PROTOC]  Generating protobuf CC file from src/proto/grpc/testing/echo.proto
third_party/protobuf/src: warning: directory does not exist.
[PROTOC]  Generating protobuf CC file from 
src/proto/grpc/testing/duplicate/echo_duplicate.proto
third_party/protobuf/src: warning: directory does not exist.
[PROTOC]  Generating protobuf CC file from src/proto/grpc/testing/stats.proto
[libprotobuf FATAL google/protobuf/generated_message_util.cc:794] CHECK failed: 
(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 
'google::protobuf::FatalException'
  what():  CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == 
(SCCInfoBase::kRunning):
[libprotobuf FATAL google/protobuf/generated_message_util.cc:794] CHECK failed: 
(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 
'google::protobuf::FatalException'
  what():  CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == 
(SCCInfoBase::kRunning):
[libprotobuf FATAL google/protobuf/generated_message_util.cc:794] CHECK failed: 
(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 
'google::protobuf::FatalException'
  what():  CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == 
(SCCInfoBase::kRunning):
[GRPC]    Generating gRPC's protobuf service CC file from 
src/proto/grpc/testing/messages.proto
third_party/protobuf/src: warning: directory does not exist.
third_party/protobuf/src: warning: directory does not exist.
third_party/protobuf/src: warning: directory does not exist.
third_party/protobuf/src: warning: directory does not exist.
[libprotobuf FATAL google/protobuf/generated_message_util.cc:794] CHECK failed: 
(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 
'google::protobuf::FatalException'
  what():  CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == 
(SCCInfoBase::kRunning):
third_party/protobuf/src: warning: directory does not exist.
[libprotobuf FATAL google/protobuf/generated_message_util.cc:794] CHECK failed: 
(scc->visit_status.load(std::memory_order_relaxed)) == (SCCInfoBase::kRunning):
terminate called after throwing an instance of 
'google::protobuf::FatalException'
  what():  CHECK failed: (scc->visit_status.load(std::memory_order_relaxed)) == 
(SCCInfoBase::kRunning):
--grpc_out: protoc-gen-grpc: Plugin killed by signal 6.
make[4]: *** 
[/home/bmahler/git/mesos3/build/3rdparty/grpc-1.10.0/gens/src/proto/grpc/testing/messages.grpc.pb.cc]
 Error 1
{noformat}

[~chhsia0] found that adding {{-pthread}} unbreaks it. And adding {{-pthread}} 
to the cmake build is not necessary because:

{quote}
I think you’re right about pthread.
Seems I can compile grpc w/ protobuf 3.7 if I put `-pthread` in the grpc 
compilation flags.
As long as I put `-pthread` in `LDFLAGS` grpc would compile. Haven’t understood 
what the root cause is yet but I’m studying another issue right now.
Also not sure if bumping grpc would fix this or not.

I used the following configuration flags to make grpc compile, but I think the 
only essential flag is `-pthread`:
```../configure CC=clang CXX=clang++ LDFLAGS='-fuse-ld=gold -pthread' 
--disable-python --disable-java```

No problem w/ cmake. It seems that gRPC’s cmake file doesn’t list those files 
triggering the crash as a dependency for the compiled libs.
it’s the `grpc_cpp_plugin` crashing inside `protoc`. Looking at the compilation 
messages from grpc, it does compiles some proto files, just not those which 
triggered the crash.
{quote}

> Upgrade bundled protobuf to 3.7.x.
> ----------------------------------
>
>                 Key: MESOS-9755
>                 URL: https://issues.apache.org/jira/browse/MESOS-9755
>             Project: Mesos
>          Issue Type: Wish
>            Reporter: Kaiwalya Joshi
>            Priority: Major
>              Labels: foundations, integration, protobuf
>
> We're noticing the following warning emitted by the JVM on JDK9+ for Google 
> Protobuf _v3.5.0_
> {code}
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil 
> (file:/home/kjoshi/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-java/3.5.0/200fb936907fbab5e521d148026f6033d4aa539e/protobuf-java-3.5.0.jar)
>  to field java.nio.Buffer.address
> WARNING: Please consider reporting this to the maintainers of 
> com.google.protobuf.UnsafeUtil
> {code}
> This warning is fixed in ProtoBuf versions [_v3.7.0_ and 
> above|https://github.com/protocolbuffers/protobuf/releases/tag/v3.7.0].
> As the current access warning can turn into an access violation in later 
> versions of the JDK, we're requesting Mesos to update to a version of 
> ProtoBuf that incorporates the needed fixes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to