[Spice-devel] [PATCH spice-streaming-agent 1/2] Implement version checking for plugins without violating ODR
Christophe Fergeau
cfergeau at redhat.com
Wed Nov 22 17:26:22 UTC 2017
On Wed, Nov 22, 2017 at 06:19:34PM +0100, Christophe Fergeau wrote:
> On Wed, Nov 22, 2017 at 04:33:23PM +0100, Christophe de Dinechin wrote:
> > From: Christophe de Dinechin <dinechin at redhat.com>
> >
> > The C++ One Definition Rule (ODR) states that all translation units
> > must see the same definitions. In the current code, when we call
> > Agent::PluginVersionIsCompatible from the plugin, it is an ODR
> > violation as soon as we have made any change in the Agent class
> > compared to what the plugin was compiled against.
> >
> > GCC respects the Standard C++ ABI on most platforms, so I believe this
> > could be made to work despite the violation as long as we never
> > changed the order of declarations, etc. But the point of the ABI check
> > is that we should be able to change the agent interface in any way we
> > want and be safe. And technically, the safe cases would still be an
> > ODR violation that relies on knowledge of implementation details.
> >
> > Another issue is that we don't want to have to rely on the plugins to
> > do the version checks. It is more robust to do it in the agent, where
> > it ensures that it is done in a consistent way and with consistent
> > error messages. As a matter of fact, the new check is robust against
> > older plugins and will not load them.
> >
> > The mechanism implemented here is similar to what libtool uses.
> > It lets any interface update be marked as either compatible with
> > earlier plugins or incompatible.
>
> I don't think fixing that issue with Agent::PluginVersionIsCompatible
> requires switching to that libtool ABI versioning, does it? In other
> word, do these 2 changes (a bug fix, and a functional change) have to go
> in the same commit?
Oh, and just realized that the log does not have any explanation of how
you fixed this bug, nor how the suggested versioning works.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20171122/43d3f2aa/attachment-0001.sig>
More information about the Spice-devel
mailing list