On Fri, Jun 19, 2020 at 05:57:48AM +0000, Koakuma wrote:
> Both ldomctl and ldomd always crashes on this machine. I'm not sure if
> it's
> related or not, so I'm including both the symptoms here for
> completeness.
Thank you for the proper report.
> 1. When running "ldomctl init-system ldom.conf", ldomctl crashes with
> a segmentation fault. Running a gdb backtrace on the core file gives me
> this:
>
> #0 0x000000b69bd0506c in md_add_prop () from /usr/sbin/ldomctl
> #1 0x000000b69bd050b4 in md_add_prop_arc () from /usr/sbin/ldomctl
> #2 0x000000b69bd0e2a8 in hvmd_finalize_pcie_device () from
> /usr/sbin/ldomctl
> #3 0x000000b69bd0e4d0 in hvmd_finalize_devices () from
> /usr/sbin/ldomctl
> #4 0x000000b69bd0e7c4 in hvmd_finalize () from /usr/sbin/ldomctl
> #5 0x000000b69bd0fe90 in build_config () from /usr/sbin/ldomctl
> #6 0x000000b69bd0238c in main () from /usr/sbin/ldomctl
This seems to happen on T4-2 machines only, T200, T5220, T5240 and T4-1
are known to work. I've briefly looked into this before but shelved it
since noone else reported it; diff below works around the issue such
that `init-system' works as expected, but it does not fix the bug:
Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.40
diff -u -p -r1.40 config.c
--- config.c 24 May 2020 22:08:54 -0000 1.40
+++ config.c 19 Jun 2020 12:26:21 -0000
@@ -1144,6 +1144,7 @@ hvmd_finalize_pcie_device(struct md *md,
TAILQ_FOREACH(subdevice, &device->guest->subdevice_list, link) {
TAILQ_FOREACH(component, &components, link) {
if (strcmp(subdevice->path, component->path) == 0)
+ if (component->hv_node == NULL) /* XXX fix
components */
md_link_node(md, parent, component->hv_node);
}
}
> 2. ldomd always crashes 10-30 minutes after starting. Running it
> manually
> with "ldomd -d" gives me this error:
>
> ldomd: Cannot allocate memory
I have never seen or reproduced this before.