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

System.IndexOutOfRangeException when serializing dictionary #97

Open
furlongmt opened this issue Sep 20, 2021 · 0 comments
Open

System.IndexOutOfRangeException when serializing dictionary #97

furlongmt opened this issue Sep 20, 2021 · 0 comments

Comments

@furlongmt
Copy link

Hi,

I am using Ceras (4.1.7) and running into the following exception when serializing a dictionary. It only seems to happen intermittently (we're seeing this issue in production), but I can try to track down a particular input that causes this issue. Here is the stack trace we're getting:

   System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Ceras.Helpers.TypeDictionary`1.AddKey(Type key, Int32 bucketIndex) in C:\projects\ceras\src\Ceras\Helpers\TypeDictionary.cs:line 256
   at Ceras.Formatters.TypeFormatter.Serialize(Byte[]& buffer, Int32& offset, Type type) in C:\projects\ceras\src\Ceras\Formatters\TypeFormatter.cs:line 52
   at Ceras.Formatters.TypeFormatter.Serialize(Byte[]& buffer, Int32& offset, Type type) in C:\projects\ceras\src\Ceras\Formatters\TypeFormatter.cs:line 52
   at Ceras.Formatters.TypeFormatter.Serialize(Byte[]& buffer, Int32& offset, Type type) in C:\projects\ceras\src\Ceras\Formatters\TypeFormatter.cs:line 52
   at Ceras.Formatters.ReferenceFormatter`1.Serialize(Byte[]& buffer, Int32& offset, T value) in C:\projects\ceras\src\Ceras\Formatters\ReferenceFormatter.cs:line 176
   at lambda_method(Closure , Byte[]& , Int32& , SingleContentResponse )
   at Ceras.Formatters.ReferenceFormatter`1.Serialize(Byte[]& buffer, Int32& offset, T value) in C:\projects\ceras\src\Ceras\Formatters\ReferenceFormatter.cs:line 176
   at Ceras.CerasSerializer.Serialize[T](T obj, Byte[]& buffer, Int32 offset) in C:\projects\ceras\src\Ceras\CerasSerializer.cs:line 438
   at Ceras.CerasSerializer.Serialize[T](T obj) in C:\projects\ceras\src\Ceras\CerasSerializer.cs:line 384

Does anyone have any ideas what could cause this?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant