we have one computer that crashes regularly and produces a corrupted ODB. while
debugging it, I discovered that for some ODB corruptions and for some unexpected
ODB errors, the ODB JSON encoder will produce invalid JSON files that cannot be
reloaded, and also produce zero-size JSON files without any explicit error
message.
these problems are now corrected, odbedit save odb.json will now always
produce valid JSON (ODB errors are encoded as JSON "null"), and always
write the encoded JSON data to odb.json, even if there were encoding errors.
to remember, the JSON encoder I originally wrote in C (before MIDAS wholesale
switch to C++). The JSON parser (mjson.h, mjson.cxx) and the JSON ODB decoder
(json_paste.cxx) I originally wrote in pre-C++11 C++ (odb.c was still in C
at the time, this is why json_paste.cxx is a separate file). all of them
are now updated to C++11.
merge commit 8a4c52da22f67ba7cbfc7d98a0fc81eeccdc7111
K.O. |