IPv6 method "shared" causes segfault in main NM process
I've discovered a segfault in Network Manager while working on utility for it. Long story short, it apparently happens when IPv6 configuration method is set to "SHARED" and IPv6 is supported by upstream (primary) connection. Setting IPv6 method to "DISABLED" avoids the crash. Here's the backtrace from crash:
#0 __memmove_avx_unaligned_erms_rtm () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:394
#1 0x00007ffff78613bd in g_array_append_vals () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00005555555b8abd in _garray_inaddr_add (p_arr=p_arr@entry=0x555555b48bf0, addr_family=addr_family@entry=10, addr=0xedfe58050120)
at src/core/nm-l3-config-data.c:295
#3 0x00005555555fa0e6 in nm_l3_config_data_add_nameserver (self=self@entry=0x555555b48b00, addr_family=addr_family@entry=10, nameserver=<optimized out>)
at src/core/nm-l3-config-data.c:1450
#4 0x00005555557e4254 in nm_device_copy_ip6_dns_config (self=0x555555aa0fb0, from_device=<optimized out>) at src/core/devices/nm-device.c:10465
#5 0x00007ffff79adc90 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00007ffff79addf3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7 0x00005555557eabbc in _dev_ipac6_start (self=0x555555aa0fb0) at src/core/devices/nm-device.c:11345
#8 0x00005555557eb398 in _dev_ipac6_start_continue (self=0x555555aa0fb0) at src/core/devices/nm-device.c:11370
#9 _dev_ipll6_set_llstate (self=0x555555aa0fb0, llstate=<optimized out>, lladdr=<optimized out>) at src/core/devices/nm-device.c:10573
#10 0x000055555573ad2d in _emit_changed_on_idle_cb (user_data=0x555555a56af0) at src/core/nm-l3-ipv6ll.c:221
#11 0x00007ffff7892ba4 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff78e7248 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff7892223 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x0000555555592c32 in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509
It was captured for the following NM package in Ubuntu 22.04: https://launchpad.net/ubuntu/+source/network-manager/1.35.91-0ubuntu1.