
On Mon, May 06, 2024 at 10:43:07AM +0200, Michal Privoznik wrote:
Now that we don't have any distro stuck with glib-2.56.0, we can bump the glib version. In fact, this is needed, because of g_clear_pointer. Since v7.4.0-rc1~301 we declare at compile time what version of glib APIs we want to use (by setting GLIB_VERSION_MIN_REQUIRED = GLIB_VERSION_MAX_ALLOWED = 2.56.0), regardless of actual glib version in the host.
And since we currently require glib-2.56.0 and force glib to use APIs of that version, some newer bits are slipping from us. For instance: regular function version of g_clear_pointer() is used instead of a fancy macro. So what? Well, g_clear_pointer() function typecasts passed free function to void (*)(void *) and then calls it. Well, this triggers UBSAN, understandably. But with glib-2.58.0 the g_clear_pointer() becomes a macro which calls the free function directly, with no typecasting and thus no undefined behavior.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- meson.build | 2 +- src/libvirt_private.syms | 1 - src/util/glibcompat.c | 125 --------------------------------------- src/util/glibcompat.h | 10 ---- 4 files changed, 1 insertion(+), 137 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|