[grpc-io] /usr/local/include/google/protobuf/repeated_field.h:145:1: error: invalid application of 'sizeof' to incomplete type 'google::protobuf::__uint128_t'

2023-03-22 Thread xiaoliang jiao
I use gRPC 1.53.0-pre1 and protobuf 3.21.12.0. 
I can create *.pb.h,  *.pb.cc, *.grpc.pb.h, *.grpc.pb.cc files from *.proto 
file.
But when i link grpc, it tells me about: this is the problem link 
.  how can i solve it, thanks 
for your help and time!


In file included from 
/usr/local/include/google/protobuf/implicit_weak_message.h:39:0,
from /usr/local/include/google/protobuf/generated_message_util.h:54,
from /catkin_ws/build/nav_interfaces/dynamic_localmap.pb.h:26,
from 
/catkin_ws/src/Navigation_ARM/Navigation/MappingModule/src/ros/DynamicMapManager/include/grpc_proto_utils.h:5,
from 
/catkin_ws/src/Navigation_ARM/Navigation/MappingModule/src/ros/DynamicMapManager/include/DynamicMapManager.h:63,
from 
/catkin_ws/src/Navigation_ARM/Navigation/MappingModule/src/ros/DynamicMapManager/src/DynamicMapManager_node.cpp:1:
/usr/local/include/google/protobuf/repeated_field.h: At global scope:
/usr/local/include/google/protobuf/repeated_field.h:145:1: error: invalid 
application of 'sizeof' to incomplete type 'google::protobuf::__uint128_t'
PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
^
/usr/local/include/google/protobuf/repeated_field.h:145:1: error: template 
argument 1 is invalid
PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
^
/usr/local/include/google/protobuf/repeated_field.h: In function 'int 
google::protobuf::internal::memswap(char*, char*)':
/usr/local/include/google/protobuf/repeated_field.h:145:1: error: invalid 
application of 'sizeof' to incomplete type 'google::protobuf::__uint128_t'
PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
^
/usr/local/include/google/protobuf/repeated_field.h:145:1: error: invalid 
application of 'sizeof' to incomplete type 'google::protobuf::__uint128_t'
PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
^
/usr/local/include/google/protobuf/repeated_field.h:145:1: error: invalid 
application of 'sizeof' to incomplete type 'google::protobuf::__uint128_t'
PROTO_MEMSWAP_DEF_SIZE(__uint128_t, (1u << 31))
^

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d05e625b-6ee4-46dc-8d43-a53849f4419cn%40googlegroups.com.


[grpc-io] Re: Updates on gRPC C# (Grpc.Core) support

2023-03-22 Thread Benjamin Krämer
Since May is approaching fast, I just want to remind everyone again, 
that https://github.com/dotnet/aspnetcore/issues/35077 is still not 
considered for ASP.NET Core 8 and whoever is currently using Grpc.Core on 
Android or with MAUI will be left without a way forward.

We on our part are evaluating if it's possible to write a compatibility 
layer for our use-case (to not be blocked by the missing ASP.NET Framework 
for Android) or if we just stick with Grpc.Core, hoping, that no security 
relevant events make it necessary to fork and patch ourselves before 
Microsoft brings us gRPC support for Android.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/3e4a52ec-8fed-42ca-a74b-d1517798f4dfn%40googlegroups.com.


[grpc-io] io.grpc.internal.ManagedChannelImpl$NameResolverListener handleErrorInSyncContext

2023-03-22 Thread VALENTINA FERRO
Hi,
I have this problem 
io.grpc.internal.ManagedChannelImpl$NameResolverListener 
handleErrorInSyncContext:

mar 22, 2023 3:27:48 PM 
io.grpc.internal.ManagedChannelImpl$NameResolverListener 
handleErrorInSyncContext
WARNING: [Channel<1>: (voloOK:50051)] Failed to resolve name. 
status=Status{code=UNAVAILABLE, description=Unable to resolve host voloOK, 
cause=java.lang.RuntimeException: java.net.UnknownHostException: Host 
sconosciuto (voloOK)
at 
io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.net.UnknownHostException: Host sconosciuto (voloOK)
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at 
java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
at 
java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1048)
at 
java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1648)
at 
java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:997)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1638)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1504)
at 
io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:631)
at 
io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:219)
... 5 more
}
Exception in thread "AWT-EventQueue-0" io.grpc.StatusRuntimeException: 
UNAVAILABLE: Unable to resolve host voloOK
at io.grpc.Status.asRuntimeException(Status.java:539)
at 
io.grpc.stub.ClientCalls$BlockingResponseStream.hasNext(ClientCalls.java:662)
at clientGrpc.Client.promozioni(Client.java:245)
at 
observer_mediator.observer.Controller_Director.notificaWidget(Controller_Director.java:331)
at 
observer_mediator.mediator.ConcreteWidgetClass.notifica(ConcreteWidgetClass.java:28)
at 
observer_mediator.mediator.ConcreteWidgetClass$2.mouseClicked(ConcreteWidgetClass.java:56)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6619)
at 
java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3398)
at java.desktop/java.awt.Component.processEvent(Component.java:6381)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4991)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4823)
at 
java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at 
java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4584)
at 
java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4823)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
at 
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at 
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.RuntimeException: java.net.UnknownHostException: Host 
sconosciuto (voloOK)
at 
io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:2

[grpc-io] Re: multiple async clients for route_guide_callback_server example

2023-03-22 Thread Dmitry Gorelov
Please check the following code, it fixes the crash of the 
route_guide_callback_server!

 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
 #include "helper.h"
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #ifdef BAZEL_BUILD
 #include "examples/protos/route_guide.grpc.pb.h"
 #else
 #include "route_guide.grpc.pb.h"
 #endif
 
 using grpc::CallbackServerContext;
 using grpc::Server;
 using grpc::ServerBuilder;
 using grpc::Status;
 using routeguide::Feature;
 using routeguide::Point;
 using routeguide::Rectangle;
 using routeguide::RouteGuide;
 using routeguide::RouteNote;
 using routeguide::RouteSummary;
 using std::chrono::system_clock;
 
 class RouteGuideImpl final : public RouteGuide::CallbackService {
  public:
   explicit RouteGuideImpl(const std::string& db) {
 routeguide::ParseDb(db, &feature_list_);
   }
 
   grpc::ServerBidiReactor* RouteChat(
   CallbackServerContext* context) override {
 class Chatter : public grpc::ServerBidiReactor {
  public:
   Chatter(absl::Mutex* mu, std::vector* 
received_notes)
   : mu_(mu), received_notes_(received_notes) {
 StartRead(¬e_);
   }
 
   void OnDone() override { delete this; }
   void OnReadDone(bool ok) override 
   {
 if (ok) 
 {
   // Unlike the other example in this directory that's not 
using
   // the reactor pattern, we can't grab a local lock to 
secure the
   // access to the notes vector, because the reactor will 
most likely
   // make us jump threads, so we'll have to use a 
different locking
   // strategy. We'll grab the lock locally to build a copy 
of the
   // list of nodes we're going to send, then we'll grab 
the lock
   // again to append the received note to the existing 
vector.
   mu_->Lock();
   std::copy_if(received_notes_->begin(), 
received_notes_->end(),
std::back_inserter(to_send_notes_),
[this](const RouteNote& note) {
  return note.location().latitude() ==
 note_.location().latitude() &&
 note.location().longitude() ==
 note_.location().longitude();
});  
   notes_iterator_ = to_send_notes_.begin();
   mu_->Unlock();
   NextWrite();
 } else {
   //std::cout << "some client finished" << std::endl;
   Finish(Status::OK);
 }
   }
   void OnWriteDone(bool ok) override 
   { 
 if (ok)
 {
   NextWrite(); 
 }
 else
 {
   std::cout << "some client finished write" << std::endl;
   Finish(Status::OK);
 }
   }
 
  private:
   void NextWrite() 
   {
 mu_->Lock();
 if (notes_iterator_ != to_send_notes_.end()) {
   StartWrite(&*notes_iterator_);
   notes_iterator_++;
 } else {  
   received_notes_->push_back(note_);  
   StartRead(¬e_);
 }
 mu_->Unlock();
   }
   RouteNote note_;
   absl::Mutex* mu_;
   std::vector* received_notes_;
   std::vector to_send_notes_;
   std::vector::iterator notes_iterator_;
 };
 return new Chatter(&mu_, &received_notes_);
   }
 
  private:
   std::vector feature_list_;
   absl::Mutex mu_;
   std::vector received_notes_ ABSL_GUARDED_BY(mu_);
 };
 
 void RunServer(const std::string& db_path) {
   std::string server_address("0.0.0.0:50051");
   RouteGuideImpl service(db_path);
 
   ServerBuilder builder;
   builder.AddListeningPort(server_address, 
grpc::InsecureServerCredentials());
   builder.RegisterService(&service);
   std::unique_ptr server(builder.BuildAndStart());
   std::cout << "Server listening on " << server_address << 
std::endl;
   server->Wait

[grpc-io] Re: multiple async clients for route_guide_callback_server example

2023-03-22 Thread Dmitry Gorelov


I found that on a server side the mutex mu is locking only the 
received_notes. But the to_send_notes are not locked and get accessed from 
different functions, that are called by bidirectional core from different 
threads. Slight modification of code made the server stable! (see how I 
placed the mutext lock).
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
 #include "helper.h"
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #ifdef BAZEL_BUILD
 #include "examples/protos/route_guide.grpc.pb.h"
 #else
 #include "route_guide.grpc.pb.h"
 #endif
 
 using grpc::CallbackServerContext;
 using grpc::Server;
 using grpc::ServerBuilder;
 using grpc::Status;
 using routeguide::Feature;
 using routeguide::Point;
 using routeguide::Rectangle;
 using routeguide::RouteGuide;
 using routeguide::RouteNote;
 using routeguide::RouteSummary;
 using std::chrono::system_clock;
 
 class RouteGuideImpl final : public RouteGuide::CallbackService {
  public:
   explicit RouteGuideImpl(const std::string& db) {
 routeguide::ParseDb(db, &feature_list_);
   }
 
   grpc::ServerBidiReactor* RouteChat(
   CallbackServerContext* context) override {
 class Chatter : public grpc::ServerBidiReactor {
  public:
   Chatter(absl::Mutex* mu, std::vector* 
received_notes)
   : mu_(mu), received_notes_(received_notes) {
 StartRead(¬e_);
   }
 
   void OnDone() override { delete this; }
   void OnReadDone(bool ok) override 
   {
 if (ok) 
 {
   // Unlike the other example in this directory that's not 
using
   // the reactor pattern, we can't grab a local lock to 
secure the
   // access to the notes vector, because the reactor will 
most likely
   // make us jump threads, so we'll have to use a 
different locking
   // strategy. We'll grab the lock locally to build a copy 
of the
   // list of nodes we're going to send, then we'll grab 
the lock
   // again to append the received note to the existing 
vector.
   mu_->Lock();
   std::copy_if(received_notes_->begin(), 
received_notes_->end(),
std::back_inserter(to_send_notes_),
[this](const RouteNote& note) {
  return note.location().latitude() ==
 note_.location().latitude() &&
 note.location().longitude() ==
 note_.location().longitude();
});  
   notes_iterator_ = to_send_notes_.begin();
   mu_->Unlock();
   NextWrite();
 } else {
   //std::cout << "some client finished" << std::endl;
   Finish(Status::OK);
 }
   }
   void OnWriteDone(bool ok) override 
   { 
 if (ok)
 {
   NextWrite(); 
 }
 else
 {
   std::cout << "some client finished write" << std::endl;
   Finish(Status::OK);
 }
   }
 
  private:
   void NextWrite() 
   {
 mu_->Lock();
 if (notes_iterator_ != to_send_notes_.end()) {
   StartWrite(&*notes_iterator_);
   notes_iterator_++;
 } else {  
   received_notes_->push_back(note_);  
   StartRead(¬e_);
 }
 mu_->Unlock();
   }
   RouteNote note_;
   absl::Mutex* mu_;
   std::vector* received_notes_;
   std::vector to_send_notes_;
   std::vector::iterator notes_iterator_;
 };
 return new Chatter(&mu_, &received_notes_);
   }
 
  private:
   std::vector feature_list_;
   absl::Mutex mu_;
   std::vector received_notes_ ABSL_GUARDED_BY(mu_);
 };
 
 void RunServer(const std::string& db_path) {
   std::string server_address("0.0.0.0:50051");
   RouteGuideImpl service(db_path);
 
   ServerBuilder builder;
   builder.AddListeningPort(server_address, 
grpc::InsecureServer