I sounds to me like this symbol duplication is causing a C++ ODR
(one-definition rule) violation, which could explain the crashes you have
seen. I would try moving the compiled proto symbols into a separate library
and have both the client and server libs depend on that same library so
that there is no duplication of the proto symbols.

On Tue, Jun 21, 2016 at 6:54 AM, Steve Beckert <s.w.beck...@gmail.com>
wrote:

>
> System
> 1 process with 2 components - a client and a server
> Both Client and Server make use of a Model.proto
> Client and Server are built with different versions of Model.proto
>
> Build
> Server generates .h and .cc files at buildtime and compiles them into
> libServer.so. Sever's use of the proto is contained solely within
> libServer.so
> Client also generates .h and .cc files at buildtime and builds a library
> libClientProto.so. Client's use of the proto is in a different library
> libClient.so
> libClient depends on both libServer and libClientProto
>
> Runtime
> How do I guarantee at runtime that libClient uses libClientProto to create
> proto classes instead of libServer, since both libClientProto and libServer
> supply the same proto symbols?
> Even though Client and Server communicate with serialized proto objects,
> if Client was built with version 1 of Model.proto but Server was built with
> version 2, I see crashes when destructing proto classes due libClient using
> libServer for its proto.
>
> I know a better approach would be to ensure the proto .cc files are
> compiled into the same library where the proto classes are used, but how
> can I prevent a future Client2 making this same mistake above?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to