Skip to content

System.IndexOutOfRangeException when serializing dictionary #97

@furlongmt

Description

@furlongmt

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions