Skip to content

Workaround for known yaml-cpp iterator bug #499

@anderkve

Description

@anderkve

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions