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

YamlStream.Load throws ArgumentException #374

Metalnem opened this issue Dec 24, 2018 · 1 comment

YamlStream.Load throws ArgumentException #374

Metalnem opened this issue Dec 24, 2018 · 1 comment


Copy link

YamlStream.Load throws an ArgumentException (YamlException is expected) when loading the document from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):

using (var file = File.OpenText(path))
  new YamlStream().Load(file);

Full stack trace:

An unhandled exception of type 'System.ArgumentException' occurred in System.Private.CoreLib.dll: 'An item with the same key has already been added. Key: '
   at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException[T](T key)
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at YamlDotNet.RepresentationModel.YamlMappingNode.ResolveAliases(DocumentLoadingState state)
   at YamlDotNet.RepresentationModel.DocumentLoadingState.ResolveAliases()
   at YamlDotNet.RepresentationModel.YamlDocument..ctor(IParser parser)
   at YamlDotNet.RepresentationModel.YamlStream.Load(IParser parser)

Found via SharpFuzz.

@aaubry aaubry added the invalid label Jun 10, 2019
Copy link

aaubry commented Jun 10, 2019

This document uses a duplicate key, and the exception that is thrown correctly indicates that this is indeed the issue. I don't think there is any error here. Please reopen the issue if you disagree.

@aaubry aaubry closed this as completed Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants