[erlang-questions] Decoding term with ei that has a map with long atom keys

Björn-Egil Dahlberg wallentin.dahlberg@REDACTED
Thu Dec 11 01:45:15 CET 2014


I think something else is going here.

Just to be sure, I added your specific example to erl_interface tests and
that passed without problems.

If ei_decode_version(but, &index, &version) fails, that typically means you
have corrupted your binary somewhere.
ei_decode_version checks if the leading byte of the binary is 131 (the
current version).

// Björn-Egil

2014-12-11 0:18 GMT+01:00 Erik Axling <axling@REDACTED>:

> Hello!
>
> I ran into an issue where ei_decode_version seems to fail when trying to
> decode a term that contains a map with large atom keys.
>
> My message that is sent to the port looks something like this:
>
> erlang:port_command(Port, term_to_binary({cmd, type, undefined,
> #{asdadasdsadasdasdasdasda=>sadsadsada,asdsadsadsadsadsadsadasdasdsadasb=>sdsdsdsdsdb})).
>
> This fails in my port pretty quickly when doing ei_decode_version(but,
> &index, &version).
>
> It works when i send a message similar to
>
> erlang:port_command(Port, term_to_binary({cmd, type, undefined, #{b=>s,
> a=>s})).
>
> Erlang version is :
> Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10]
> [hipe] [kernel-poll:false]
>
> Eshell V6.2  (abort with ^G)
>
> Running this on a Macbook Air if that is interesting.
>
>
> I know that the maps feature is still a bit experimental so just would
> like to know if this is a known issue of if I'm understanding something
> wrong?
>
> /axling
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141211/68874da3/attachment.htm>


More information about the erlang-questions mailing list