You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use virtio-net-vpnkit, you receive the error:
Assertion failed: (sizeof("VERSION_SHA1") == sizeof(init_msg.commit) + 1), function vpnkit_connect, file /private/tmp/docker-machine-driver-xhyve-20161208-25683-18fih1b/gopath/src/github.com/zchee/docker-machine-driver-xhyve/vendor/github.com/zchee/libhyperkit/pci_virtio_net_vpnkit.c, line 303.
Looking at the mentioned line you find the offending code:
/* msg.commit is not NULL terminated */
assert(sizeof("VERSION_SHA1") == sizeof(init_msg.commit) + 1);
memcpy(&init_msg.commit, "VERSION_SHA1", sizeof(init_msg.commit));
VERSION_SHA1 should be unqouted and pointed to an actual commit sha1, so the sizeof assert validates.
The VERSION_SHA1 value is even being defined in xhyve.go but as go drops quotes when passing the option to the compiler (BUG), the C code breaks because VERSION_SHA1 does not resolve to a string, but to a weird identifier:
In docker/hyperkit, that value gets passed from the Makefile but we do not have one available here to workaround the Go bug. Maybe one solution would be to hardcode it in pci_virtio_net_vpnkit.c (or even better, an include file somewhere else) while still allowing customization:
When trying to use virtio-net-vpnkit, you receive the error:
Looking at the mentioned line you find the offending code:
VERSION_SHA1 should be unqouted and pointed to an actual commit sha1, so the sizeof assert validates.
The VERSION_SHA1 value is even being defined in xhyve.go but as go drops quotes when passing the option to the compiler (BUG), the C code breaks because VERSION_SHA1 does not resolve to a string, but to a weird identifier:
assert(sizeof(2db2b2c60799918dafb3d95368e935c3f620911d) == sizeof(init_msg.commit) + 1);
Instead of the expected:
assert(sizeof("2db2b2c60799918dafb3d95368e935c3f620911d") == sizeof(init_msg.commit) + 1);
In docker/hyperkit, that value gets passed from the Makefile but we do not have one available here to workaround the Go bug. Maybe one solution would be to hardcode it in pci_virtio_net_vpnkit.c (or even better, an include file somewhere else) while still allowing customization:
The text was updated successfully, but these errors were encountered: