We are evaluating gRPC as a potential replacement for our current communication protocol. Our customer expects systems running on Windows so I have recursively cloned the gRPC repository at the release-0_11 tag and built protoc, grpc_cpp_plugin, grpc++_unsecure.lib (secure connections aren’t required for our application) etc. per the README’s (they do need to be updated) in VS2013. I also created projects and built the ‘examples/cpp/helloworld’ async server and client successfully. The server runs but when the client attempts to “SayHello”, that is, the method GreeterClient::SayHello() is called, it fails with the exception:
Unhandled exception at 0x013C7CCF in GreeterClient.exe:
0xC0000005: Access violation reading location 0x00000000.
when calling:
std::unique_ptr<ClientAsyncResponseReader<HelloReply> > rpc(
stub_->AsyncSayHello(&context, request, &cq));
The errant line appears to be:
for (auto iter = metadata.cbegin(); iter != metadata.cend(); ++iter, ++i)
in Call::FillMetadataArray()
when calling begin() from metadata.cbegin():
Here is the entire method from Call.cc:
grpc_metadata* FillMetadataArray(
const std::multimap<grpc::string, grpc::string>& metadata) {
if (metadata.empty()) {
return nullptr;
}
grpc_metadata* metadata_array =
(grpc_metadata*)gpr_malloc(metadata.size() * sizeof(grpc_metadata));
size_t i = 0;
for (auto iter = metadata.cbegin(); iter != metadata.cend(); ++iter, ++i) {
metadata_array[i].key = iter->first.c_str();
metadata_array[i].value = iter->second.c_str();
metadata_array[i].value_length = iter->second.size();
}
return metadata_array;
}
I haven’t modified the code in any way, however I did create Visual Studio solutions for each of the GreeterClient and GretterServer.
Can you offer any ideas of what’s going on here?
Thanks for you help,
Rich
--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/f209189d-8061-4b59-b08b-9697258b0d7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.