NM segfaults when connecting to ovsdb-server if util-linux is built with --with-cryptsetup
Since util-linux version 2.35, there is an experimental feature that causes libmount to link to libcryptsetup:
mount(8) and libmount now provides built-in dm-verity support if linked with libcryptsetup. This new feature is EXPERIMENTAL and disabled by default; use --with-cryptsetup to enable.
As libmount loads libcryptsetup, libcryptsetup loads libjson-c, and libmount is loaded by libgio, libjson-c is now also loaded by NM. NetworkManager uses jansson instead of libjson-c, to handle the data from ovsdb-server. Both libraries are incompatible, but they have a symbol clash and neither of them use symbol versioning.
The result is that NM tries to use json_object_iter_next from libjson-c instead of jansson, and NM crashes with a segfault:
Thread 1 (Thread 0x7f70a054efc0 (LWP 365000)):
#0 0x00007f70a0691533 in json_object_iter_next (iter=iter@entry=0x56433cdf0470) at /var/tmp/portage/dev-libs/json-c-0.14-r3/work/json-c-0.14/json_object_iterator.c:100
#1 0x00007f709e8d0bd6 in do_dump (json=0x56433cdf0470, flags=0, depth=0, parents=0x7ffcabcb7850, dump=0x7f709e8d0550 <dump_to_strbuffer>, data=0x7ffcabcb78c0) at /var/tmp/portage/dev-libs/jansson-2.11/work/jansson-2.11/src/dump.c:400
#2 0x00007f709e8d128c in json_dump_callback (json=json@entry=0x56433cdf0470, callback=callback@entry=0x7f709e8d0550 <dump_to_strbuffer>, data=data@entry=0x7ffcabcb78c0, flags=flags@entry=0) at /var/tmp/portage/dev-libs/jansson-2.11/work/jansson-2.11/src/dump.c:500
#3 0x00007f709e8d1318 in json_dumps (json=json@entry=0x56433cdf0470, flags=flags@entry=0) at /var/tmp/portage/dev-libs/jansson-2.11/work/jansson-2.11/src/dump.c:443
#4 0x00007f709e8e79cb in ovsdb_next_command (self=self@entry=0x56433cd265f0 [NMOvsdb]) at ../NetworkManager-1.22.10/src/devices/ovs/nm-ovsdb.c:827
#5 0x00007f709e8e7e67 in _client_connect_cb (source_object=<optimized out>, res=<optimized out>, user_data=0x56433cd265f0) at ../NetworkManager-1.22.10/src/devices/ovs/nm-ovsdb.c:1433
#6 0x00007f70a19c5153 in g_task_return_now (task=0x7f7090003e40 [GTask]) at ../glib-2.62.6/gio/gtask.c:1212
#7 0x00007f70a19c5afd in g_task_return (task=0x7f7090003e40 [GTask], type=<optimized out>) at ../glib-2.62.6/gio/gtask.c:1281
#8 0x00007f70a19c611c in g_task_return (type=G_TASK_RETURN_SUCCESS, task=<optimized out>) at ../glib-2.62.6/gio/gtask.c:1684
#9 g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib-2.62.6/gio/gtask.c:1689
#10 0x0000000000000000 in ()