You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on NBench tests I've seen few places, where objects serialization ends up with stack overflow, namely:
Circular references.
LinkedList<> serialization/deserialization. This will be tricky as invalid behavior is visible only when nbench tests will be compiled and run under Release configuration. On Debug it's working fine. (Edit: fixed byCustom LinkedList serializer with tests and perf tests #6 ).
Test using Dictionary<byte, char> (upon deserialization value 'z' was deserialized to '\0' instead, the track of a bug followed back to IlCompiler) (Edit: fixed byfix for CharSerializer #4 ).
Setting serializer to use preserveObjectReferences option haven't changed anything there.
Regarding LinkedList<> probably the best option will be to implement custom serializer - conceptually this data structure is simple, but internal implementation (used by the serializer) is complex an may cause problems.
The text was updated successfully, but these errors were encountered:
About circular references.
It's not hard to check if objects with circular references was passed to serializer.
Just enough to have some HashSet called serializingObjects which will contain references on objects which serializing is finished yet.
But it is not clear what to do next? The simples way is to raise some CircularReferenceException when it happens. But is there a way how to resolve it maybe?
While working on NBench tests I've seen few places, where objects serialization ends up with stack overflow, namely:
LinkedList<>
serialization/deserialization. This will be tricky as invalid behavior is visible only when nbench tests will be compiled and run under Release configuration. On Debug it's working fine. (Edit: fixed by Custom LinkedList serializer with tests and perf tests #6 ).Dictionary<byte, char>
(upon deserialization value 'z' was deserialized to '\0' instead, the track of a bug followed back to IlCompiler) (Edit: fixed by fix for CharSerializer #4 ).Setting serializer to use
preserveObjectReferences
option haven't changed anything there.Regarding
LinkedList<>
probably the best option will be to implement custom serializer - conceptually this data structure is simple, but internal implementation (used by the serializer) is complex an may cause problems.The text was updated successfully, but these errors were encountered: