summaryrefslogtreecommitdiff
path: root/src/vmon.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-12-29 15:00:00 -0800
committerVito Caputo <vcaputo@pengaru.com>2017-12-29 15:10:05 -0800
commitd3f66266f01283d8a9e78ac0ffa9620d34d24850 (patch)
treef1b1b4219c48ba13e9f71f5abee66c862f915be0 /src/vmon.c
parent9d6f429577ec072d3f5212c29760ca70e3c93ce3 (diff)
charts: fix ancestor siblings check segfault
This loop assumed ancestor->parent was !NULL, and that's not necessarily always true. Due to these circular linked lists from the kernel's list.h, they're not simply NULL delimited and we need the pointer to the actual head to detect the end of the list. In libvmon, the head for the siblings list is either the parent proc's children member, or the processes member of the vmon struct. It may be more elegant to switch to always having a root proc in libvmon, even if it's just synthetic, for simplifying this crap. But for now, just determine which head is relevant and check against it for loop termination. Under some heavy parallel kernel compilations I was seeing occasional vwm segfaults, and the addr2line of the ip in dmesg mapped to this particular loop. I'm assuming the ancestor walk landed on a top-level process and then this sibling detection tried dereferencing the top-level proc's NULL parent and boom, segfault.
Diffstat (limited to 'src/vmon.c')
0 files changed, 0 insertions, 0 deletions
© All Rights Reserved