While working on GAMBIT-light, @idamarie1303, @ahye and I encountered a strange problem with YAML::Node loop iterators going beyond the size of given node, leading to a crash. (It's a tricky bug, because it only appears for some compiler settings / systems). It turns out this is a known bug in yaml-cpp, discussed here: jbeder/yaml-cpp#833
In GAMBIT-light we have so far opted for the workaround suggested here: jbeder/yaml-cpp#833 (comment).
Here's a part of LightBit.cpp in GAMBIT-light which demonstrates the fix: https://github.com/GambitBSM/gambit_light/blob/b6af795c22404d72ba39fbc3047358b6964b0b3b/LightBit/src/LightBit.cpp#L116-L150
Throughout GAMBIT I think we have around 10--20 iterator-based loops over YAML::Node instances, so to guard against this yaml-cpp bug we should probably implement this workaround also for all these loops.
While working on GAMBIT-light, @idamarie1303, @ahye and I encountered a strange problem with
YAML::Nodeloop iterators going beyond the size of given node, leading to a crash. (It's a tricky bug, because it only appears for some compiler settings / systems). It turns out this is a known bug inyaml-cpp, discussed here: jbeder/yaml-cpp#833In GAMBIT-light we have so far opted for the workaround suggested here: jbeder/yaml-cpp#833 (comment).
Here's a part of
LightBit.cppin GAMBIT-light which demonstrates the fix: https://github.com/GambitBSM/gambit_light/blob/b6af795c22404d72ba39fbc3047358b6964b0b3b/LightBit/src/LightBit.cpp#L116-L150Throughout GAMBIT I think we have around 10--20 iterator-based loops over
YAML::Nodeinstances, so to guard against thisyaml-cppbug we should probably implement this workaround also for all these loops.