SEGFAULT in greeter_client

32 views
Skip to first unread message

gautham....@gmail.com

unread,
Jan 24, 2019, 10:37:05 AM1/24/19
to grpc.io
Hi all,

I just cloned and built gRPC (SHA 9ed8734efb9b1b2cd892942c2c6dd57e903ce719). I'm getting SEGFAULT when I try to run greeter_client in C++. It SEGFAULTs when the RPC call is made -

Status status = stub_->SayHello(&context, request, &reply);

Here's how I'm building greeter_client -

cmake_minimum_required(VERSION 3.13)
project(HelloWorld)

set(CMAKE_CXX_STANDARD 17)

set(GRPC_BUILD_DIR
        /Users/gautham/projects/github/grpc)

set(LIB_GRPC
        ${GRPC_BUILD_DIR}/libs/opt/libgpr.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libaddress_sorting.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc++.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc++_cronet.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc++_error_details.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc++_reflection.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc++_unsecure.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc_cronet.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpc_unsecure.dylib
        ${GRPC_BUILD_DIR}/libs/opt/libgrpcpp_channelz.dylib
        )

set(LIB_PROTOBUF
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotobuf-lite.17.dylib
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotobuf-lite.dylib
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotobuf.17.dylib
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotobuf.dylib
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotoc.17.dylib
        ${GRPC_BUILD_DIR}/third_party/protobuf/src/.libs/libprotoc.dylib
        )

include_directories(
        ${GRPC_BUILD_DIR}/include
)

add_executable(greeter_client
        greeter_client.cc
        helloworld.pb.cc
        )

target_link_libraries(greeter_client
        ${LIB_GRPC}
        ${LIB_PROTOBUF}
        )

Here's the coredump -
* thread #1, stop reason = signal SIGSTOP
  * frame #0: 0x00007fffa253a19e libsystem_kernel.dylib`poll + 10
    frame #1: 0x000000010e6c01a6 libgrpc.dylib`pollset_work(pollset=<unavailable>, worker_hdl=0x00007fff519dded8, deadline=<unavailable>) at ev_poll_posix.cc:1063 [opt]
    frame #2: 0x000000010e6e5999 libgrpc.dylib`cq_pluck(cq=0x00007fad6240ae40, tag=0x00007fff519de200, deadline=<unavailable>, reserved=<unavailable>) at completion_queue.cc:1282 [opt]
    frame #3: 0x000000010e22c4d1 greeter_client`grpc::CompletionQueue::Pluck(grpc::internal::CompletionQueueTag*) + 161
    frame #4: 0x000000010e22b810 greeter_client`grpc::internal::BlockingUnaryCallImpl<helloworld::HelloRequest, helloworld::HelloReply>::BlockingUnaryCallImpl(grpc::ChannelInterface*, grpc::internal::RpcMethod const&, grpc::ClientContext*, helloworld::HelloRequest const&, helloworld::HelloReply*) + 704
    frame #5: 0x000000010e22b4ed greeter_client`grpc::internal::BlockingUnaryCallImpl<helloworld::HelloRequest, helloworld::HelloReply>::BlockingUnaryCallImpl(grpc::ChannelInterface*, grpc::internal::RpcMethod const&, grpc::ClientContext*, helloworld::HelloRequest const&, helloworld::HelloReply*) + 61
    frame #6: 0x000000010e228921 greeter_client`grpc::Status grpc::internal::BlockingUnaryCall<helloworld::HelloRequest, helloworld::HelloReply>(grpc::ChannelInterface*, grpc::internal::RpcMethod const&, grpc::ClientContext*, helloworld::HelloRequest const&, helloworld::HelloReply*) + 81
    frame #7: 0x000000010e2288c5 greeter_client`helloworld::Greeter::Stub::SayHello(grpc::ClientContext*, helloworld::HelloRequest const&, helloworld::HelloReply*) + 85
    frame #8: 0x000000010e226ecb greeter_client`GreeterClient::SayHello(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 235
    frame #9: 0x000000010e226c05 greeter_client`main + 469
    frame #10: 0x00007fffa240a235 libdyld.dylib`start + 1
    frame #11: 0x00007fffa240a235 libdyld.dylib`start + 1

I'm using macOS Sierra 10.12.6

Compiler -
clang
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix

Can anyone please help me?

Thanks,
--Gautham

Carl Mastrangelo

unread,
Feb 13, 2019, 1:36:05 PM2/13/19
to grpc.io
Hi, can you file an issue on gRPC's GitHub issue tracker?  https://github.com/grpc/grpc/issues/new

Gautham B A

unread,
Feb 13, 2019, 11:36:09 PM2/13/19
to grpc.io
I had filed it long back - https://github.com/grpc/grpc/issues/17807 .

Srini Polavarapu

unread,
Feb 14, 2019, 12:23:15 AM2/14/19
to grpc.io
Bump the priority of the Github issue to P1. Let's track it over there.
Reply all
Reply to author
Forward
0 new messages