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

Unpacker throws exception trying to read map length after IsMapHeader returns true #320

Open
ebekker opened this issue Mar 26, 2019 · 1 comment

Comments

@ebekker
Copy link

ebekker commented Mar 26, 2019

I've implemented a custom MessagePackSerializer, and when trying to deserialize my type from the byte stream, which is expected to be a Map, I get an exception.

At the point of the exception unpacker.IsMapHeader returns true, but trying to do unpacker.ReadMapLength(...) throws:
MsgPack.MessageTypeException: Cannot convert 'map' header from type 'FixedRaw'(0xA6) in position 1.

@ebekker
Copy link
Author

ebekker commented Mar 26, 2019

A sample of the byte stream:

[138,166,97,112,112,101,110,100,144,168,99,104,101,99,107,115,117,109,192,176,99,111,109,112,117,116,101,95,99,104,101,99,107,115,117,109,163,109,100,53,167,99,111,110,116,101,110,116,217,39,84,104,105,115,32,105,115,32,99,111,110,116,101,110,116,32,102,114,111,109,32,105,110,108,105,110,101,32,84,70,32,99,111,110,102,105,103,46,10,174,99,111,110,116,101,110,116,95,98,97,115,101,54,52,192,172,99,111,110,116,101,110,116,95,112,97,116,104,192,171,99,111,110,116,101,110,116,95,117,114,108,192,169,102,117,108,108,95,112,97,116,104,192,173,108,97,115,116,95,109,111,100,105,102,105,101,100,192,164,112,97,116,104,171,46,47,116,101,115,116,49,46,116,120,116]

ebekker added a commit to ebekker/terrascape that referenced this issue Mar 31, 2019
* both of the leading MsgPack implementations for .NET have problems, either ser/deser [issues](msgpack/msgpack-cli#320) or complexity in custom-mapping our TF attributes to their representation
* trying to create a super-simple, limited-purpose MP impl for our needs
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