<div dir="ltr"><div>I&#39;m trying to have osi_linux run with ubuntu-16.04, i386. My kernel offsets seem to work so far and I can see process names, pids etc. However, occasionally run into an infinite loop. My code runs on the asid_changed event. See the OSI_PROC_EVENTS block inside os_intro.c.<br><div><br></div></div><div>After investigating, it seems that the infinite loop triggers always for the systemd-cgroups process, with different pid every time. I would guess that this process acts only as a launcher. So, at the time when the asid_changed callbacks are run, the process is about to exit and has already been unlinked from the process list.<br></div><div><br></div><div>When the infinite loops occur, the starting task_struct in on_get_processes() corresponds either to a non-threaded process or a non-leader thread.</div><br><div>I can avoid the infinite loop by always starting the process enumeration from the next process of the thread group leader.</div><div><br></div><div>In theory (as depicted in kernel_structs.html) simply following the next process pointer would be adequate. However this does not resolve the infinite loops in the case where the starting task_struct is a non-leader thread.<br></div><div><br></div><div>I&#39;m not sure what I&#39;m missing here. Is this some implementation detail of 4.x we&#39;re missing? (I can&#39;t recall observing this with 3.x) Or is this a systemd-specific behaviour that didn&#39;t manifest with pre-systemd distros?<br></div><div><br></div><div>I will submit a PR with the fix avoiding the infinite loop. However this may break any plugins that make assumptions on the order of processes as returned by get_processes().</div><div><br></div><div>Any hints or feedback is welcome. I will follow up with the replay and instructions to reproduce the infinite loops.</div><div><br></div><div>Thanks in advance,</div><div>Manolis<br></div></div>