Skip to content

Commit

Permalink
qmanager-stats: fix jansson refcount issue
Browse files Browse the repository at this point in the history
problem: The `to_json` function for serializing maps with jansson had a
refcounting bug in it, which wasn't caught by address sanitizer,
valgrind, or testing.  This is what caused the issue @jamescorbett saw
in the buildfarm, but only reliably reproduced on alpine.

solution: Temporary solution is to fix the refcount problem, longer
term solution is to use something that isn't so insanely hard to use
correctly and debug.
  • Loading branch information
trws committed Aug 19, 2024
1 parent f8bd880 commit d24de78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/c++wrappers/jansson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ inline void to_json (value &jv, const MapT &m)
for (auto &[k, v] : m) {
value val;
to_json (val, v);
json_object_set_new (jv.get (), k.c_str (), val.get ());
json_object_set (jv.get (), k.c_str (), val.get ());
}
}
} // namespace json
Expand Down

0 comments on commit d24de78

Please sign in to comment.