I’m having some trouble with reading a simple TObject which contains std::map as a member from the regular root file in JSROOT (using JSROOT.OpenFile and then ReadObject).
It works well for the files that were produced using root 6.14/06, but for the files produced with root 6.18/00 the browser always complains with “Offset is outside the bounds of the DataView” and the object is not read. I’m pretty sure that std::map is an issue, as if I remove it from the TObject it works fine.
(I’m actually not interested in the content of the map itself, I would only like to get the histogram which is also a member my TObject, but since the ReadObject crashes I can’t access it)
If anyone has some idea what could be causing this issue I would appreciate.
thank you for prompt reply. Attached are the two root files and a definition file for my object. Then in javascript I just do JSROOT.OpenFile(…) and file.ReadObject(“arich”) and get the described error in case of root v18.
Now I see a difference.
Latest ROOT uses member-wise streaming for std::map. It was not good tested with JSROOT.
I provide workaround, which should work: