Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow exceptions #2

Open
2 of 3 tasks
Horusiath opened this issue Dec 15, 2016 · 1 comment
Open
2 of 3 tasks

Stack overflow exceptions #2

Horusiath opened this issue Dec 15, 2016 · 1 comment
Labels

Comments

@Horusiath
Copy link
Contributor

Horusiath commented Dec 15, 2016

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 by Custom 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 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.

@alexpantyukhin
Copy link
Contributor

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?

DaniilSokolyuk added a commit to DaniilSokolyuk/Hyperion that referenced this issue Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants