resource: traverser->run () segfaults with bidirectional edges #782
Closed
Description
As I mentioned in PR #775, passing a JGF with bidirectional edges (e.g. contains
and in
for the containment subsystem) to update allocate
in resource-query
results in a segfault. After some debugging, I traced the problem to dfu_impl_t::upd_dfv
. When the DFV reaches a leaf, it traverses back to its ancestor, then back to the leaf. This cycle repeats until producing a segfault.
However, the fix appears simple: adding a gray coloration before the loop, i.e.:
(*m_graph)[u].idata.colors[dom] = m_color.gray ();
for (auto &subsystem : m_match->subsystems ()) {
breaks the cycle and eliminates the segfault. All CI tests pass with this addition.