<div dir="auto"><div>I do think it's related with zlib, since he is calling term_to_binary, which uses it by default.<br><div class="gmail_extra"><br><div class="gmail_quote">Em 28 de jan de 2017 06:19, "Dániel Szoboszlay" <<a href="mailto:dszoboszlay@gmail.com">dszoboszlay@gmail.com</a>> escreveu:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I don't think this would be zlib related. TCP is simply a stream protocol: you put in a stream of bytes in arbitrary chunks, and on the other end you receive the same sequence of bytes, but possibly in different chunks. If you want to send a sequence of messages, it is up to the application layer to detect the message boundaries.<div><br></div><div>You can use e.g. the <font face="monospace">{packet, 4}</font> option when opening the TCP socket (on both ends), so Erlang will add a 4-byte size header to every message you send, and on the receiving end it will wait for a whole message to arrive before handing off the bytes to your application. This will work only up to 4GB messages of course.</div><div><br></div><div>Alternatively, you may implement a streaming version of <font face="monospace">binary_to_term</font>, which will tell you if you gave it too few or too many bytes to parse a whole term from them.</div><div><br></div><div>Cheers,</div><div>Daniel</div></div><div class="elided-text"><br><div class="gmail_quote"><div dir="ltr">On Sat, 28 Jan 2017 at 08:12 José Valim <<a href="mailto:jose.valim@plataformatec.com.br" target="_blank">jose.valim@plataformatec.com.<wbr>br</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_7772327218272418810gmail_msg">What is your zlib version? There has been a thread about a very similar issue and it was pinpointed to be related to the zlib version in your system: <a href="http://erlang.org/pipermail/erlang-questions/2017-January/091434.html" class="m_7772327218272418810gmail_msg" target="_blank">http://erlang.org/<wbr>pipermail/erlang-questions/<wbr>2017-January/091434.html</a></div><div class="gmail_extra m_7772327218272418810gmail_msg"></div><div class="gmail_extra m_7772327218272418810gmail_msg"><br clear="all" class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810m_-5858961315176965860gmail_signature m_7772327218272418810gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg"><span style="font-size:13px" class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810gmail_msg"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse" class="m_7772327218272418810gmail_msg"><b class="m_7772327218272418810gmail_msg">José Valim</b></span></div><div class="m_7772327218272418810gmail_msg"><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse" class="m_7772327218272418810gmail_msg"><div class="m_7772327218272418810gmail_msg"><span style="font-family:verdana,sans-serif;font-size:x-small" class="m_7772327218272418810gmail_msg"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" class="m_7772327218272418810gmail_msg" target="_blank">www.plataformatec.com.br</a></span></div><div class="m_7772327218272418810gmail_msg"><span style="font-family:verdana,sans-serif;font-size:x-small" class="m_7772327218272418810gmail_msg">Skype: jv.ptec</span></div><div class="m_7772327218272418810gmail_msg"><span style="font-family:verdana,sans-serif;font-size:x-small" class="m_7772327218272418810gmail_msg">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div></div><div class="gmail_extra m_7772327218272418810gmail_msg">
<br class="m_7772327218272418810gmail_msg"><div class="gmail_quote m_7772327218272418810gmail_msg">On Sat, Jan 28, 2017 at 1:55 AM, Kevin Johnson <span dir="ltr" class="m_7772327218272418810gmail_msg"><<a href="mailto:johnson786.kevin@gmail.com" class="m_7772327218272418810gmail_msg" target="_blank">johnson786.kevin@gmail.com</a>></span> wrote:<br class="m_7772327218272418810gmail_msg"><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_7772327218272418810gmail_msg">Hi,<div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">I am using Elixir to send data using :gen_tcp. The syntax presented here may be elementary Elixir syntax, however the issue is specifically related to the usage of term_to_binary and binary_to_term conversions over gen_tcp.<br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">This is the command I used on the client side:</div><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">:gen_tcp.send(client_socket, :erlang.term_to_binary(data))</blockquote><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">This is the command I use on the server side:</div><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> defp handle_data(data) do<br class="m_7772327218272418810gmail_msg"> data<br class="m_7772327218272418810gmail_msg"> |> :erlang.binary_to_term<br class="m_7772327218272418810gmail_msg"> end</blockquote><div class="m_7772327218272418810gmail_msg"> </div><div class="m_7772327218272418810gmail_msg">When my data gets received on the server side, it seems that at a certain size threshold that it errors out like this:</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">pry(6)> [error] GenServer #PID<0.502.0> terminating</blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">** (ArgumentError) argument error </blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> :erlang.binary_to_term(<<131, 116, 0, 0, 0, 28, 109, 0, 0, 0, 5, 66, 49, 95, 81, 49, 108, 0, 0, 0, 1, 116, 0, 0, 0, 1, 109, 0, 0, 0, 4, 116, 101, 120, 116, 109, 0, 0, 0, 11, 84, 69, 88, 84, 32, 65, 78, 83, 87, 69, ...>>)</blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(stdlib) gen_server.erl:601: :gen_server.try_dispatch/4</blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(stdlib) gen_server.erl:667: :gen_server.handle_msg/5</blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3</blockquote><blockquote class="gmail_quote m_7772327218272418810gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Last message: {:tcp, #Port<0.10115>, <<131, 116, 0, 0, 0, 28, 109, 0, 0, 0, 5, 66, 49, 95, 81, 49, 108, 0, 0, 0, 1, 116, 0, 0, 0, 1, 109, 0, 0, 0, 4, 116, 101, 120, 116, 109, 0, 0, 0, 11, 84, 69, 88, 84, 32, 65, 78, 83, ...>>} </blockquote><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">Here is some example data that will just pass fine:</div><div class="m_7772327218272418810gmail_msg">%{"B2_Q18" => [%{"choice_id" => "B2_Q18_C1"}], "B3_B9_Q1" => [%{"choice_id" => "B3_B9_Q1_C1"}], "B2_Q7" => [%{"choice_id" => "B2_Q7_C1"}], "B5_B1_Q8" => [%{"choice_id" => "B5_B1_Q8_C1"}], "B3_B6_Q1" => [%{"choice_id" => "B3_B6_Q1_C1"}], "B5_B2_Q5" => [%{"choice_id" => "B5_B2_Q5_C1"}, %{"choice_id" => "B5_B2_Q5_C2"}], "B3_B7_Q1" => [%{"choice_id" => "B3_B7_Q1_C1"}], "B3_B4_Q1" => [%{"choice_id" => "B3_B4_Q1_C1"}], "B2_Q16" => [%{"choice_id" => "B2_Q16_C1"}], "B2_Q20" => [%{"choice_id" => "B2_Q20_C1"}], "B2_Q5" => [%{"choice_id" => "B2_Q5_C1"}], "B2_Q9" => [%{"choice_id" => "B2_Q9_C1"}], "B2_Q17" => [%{"choice_id" => "B2_Q17_C1"}], "B3_B2_Q1" => [%{"choice_id" => "B3_B2_Q1_C1"}], "B5_B2_Q3" => [%{"choice_id" => "B5_B2_Q3_C1"}], "B3_B3_Q1" => [%{"choice_id" => "B3_B3_Q1_C1"}], "B5_B1_Q1" => [%{"text" => "TEXT ANSWER"}], "B2_Q14" => [%{"choice_id" => "B2_Q14_C1"}], "B5_B1_Q3" => [%{"choice_id" => "B5_B1_Q3_C22"}], "B5_B2_Q2" => [%{"choice_id" => "B5_B2_Q2_C1"}], "B2_Q4" => [%{"choice_id" => "B2_Q4_C1"}], "B2_Q10" => [%{"choice_id" => "B2_Q10_C1"}], "B4_Q1" => [%{"choice_id" => "B4_Q1_C1"}, %{"choice_id" => "B4_Q1_C10"}], "B5_B1_Q6" => [%{"choice_id" => "B5_B1_Q6_C1"}], "B2_Q6" => [%{"choice_id" => "B2_Q6_C1"}], "B2_Q2" => [%{"choice_id" => "B2_Q2_C1"}], "B2_Q1" => [%{"choice_id" => "B2_Q1_C1"}]}<br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">The moment I make it slightly longer, by like appending an extra key "a" => "b" it will give me the above error.</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">It seems to be that the size of the keys plays an issue here, because if I convert all the above "choice_id" keys to a mere "c", then even with the extra entry "a" => "b" included like following below will work just fine:</div><div class="m_7772327218272418810gmail_msg">%{"B2_Q18" => [%{"c" => "B2_Q18_C1"}], "B3_B9_Q1" => [%{"c" => "B3_B9_Q1_C1"}], "B2_Q7" => [%{"c" => "B2_Q7_C1"}], "B5_B1_Q8" => [%{"c" => "B5_B1_Q8_C1"}], "B3_B6_Q1" => [%{"c" => "B3_B6_Q1_C1"}], "B5_B2_Q5" => [%{"c" => "B5_B2_Q5_C1"}, %{"c" => "B5_B2_Q5_C2"}], "B3_B7_Q1" => [%{"c" => "B3_B7_Q1_C1"}], "B3_B4_Q1" => [%{"c" => "B3_B4_Q1_C1"}], "B2_Q16" => [%{"c" => "B2_Q16_C1"}], "B2_Q20" => [%{"c" => "B2_Q20_C1"}], "B2_Q5" => [%{"c" => "B2_Q5_C1"}], "B2_Q9" => [%{"c" => "B2_Q9_C1"}], "B2_Q17" => [%{"c" => "B2_Q17_C1"}], "B3_B2_Q1" => [%{"c" => "B3_B2_Q1_C1"}], "B5_B2_Q3" => [%{"c" => "B5_B2_Q3_C1"}], "B3_B3_Q1" => [%{"c" => "B3_B3_Q1_C1"}], "B5_B1_Q1" => [%{"text" => "TEXT ANSWER"}], "B2_Q14" => [%{"c" => "B2_Q14_C1"}], "B5_B1_Q3" => [%{"c" => "B5_B1_Q3_C22"}], "B5_B2_Q2" => [%{"c" => "B5_B2_Q2_C1"}], "B2_Q4" => [%{"c" => "B2_Q4_C1"}], "B2_Q10" => [%{"c" => "B2_Q10_C1"}], "B4_Q1" => [%{"c" => "B4_Q1_C1"}, %{"c" => "B4_Q1_C10"}], "B5_B1_Q6" => [%{"c" => "B5_B1_Q6_C1"}], "B2_Q6" => [%{"c" => "B2_Q6_C1"}], "B2_Q2" => [%{"c" => "B2_Q2_C1"}], "B2_Q1" => [%{"c" => "B2_Q1_C1"}], "a" => "b"}<br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">The following on the other hand will just fail:</div><div class="m_7772327218272418810gm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bbbbbbbbbbbbb" => "q", "<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>cccccccccccccccccccccccccccccc<wbr>ccccccccccccccc" => "q"}<br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">:gen_tcp.send(client_socket, :erlang.term_to_binary(data))</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">The only issue that I was able to track down here is a conjunction of two things:</div><div class="m_7772327218272418810gmail_msg">1) A limit to the size of total key length inside a map/hash</div><div class="m_7772327218272418810gmail_msg">2) sending that hash as a binary over tcp and converting back to term</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">In all of the above cases, a direct conversion of :erlang.term_to_binary followed by :erlang.binary_to_term works just fine without any issues. The issue only comes about after that binary was send over tcp and then :erlang.binary_to_term is attempted.</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">I would greatly appreciate if anyone can provide me guidance in this matter, point out to me any relevant documentation that officially states any of these constraints if they are in fact constraints, and if they are not supposed to be constraints then kindly instruct me what additional information may be needed for me to get to the bottom of this.</div><div class="m_7772327218272418810gmail_msg"><br class="m_7772327218272418810gmail_msg"></div><div class="m_7772327218272418810gmail_msg">Thank you.</div></div>
<br class="m_7772327218272418810gmail_msg">______________________________<wbr>_________________<br class="m_7772327218272418810gmail_msg">
erlang-questions mailing list<br class="m_7772327218272418810gmail_msg">
<a href="mailto:erlang-questions@erlang.org" class="m_7772327218272418810gmail_msg" target="_blank">erlang-questions@erlang.org</a><br class="m_7772327218272418810gmail_msg">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" class="m_7772327218272418810gmail_msg" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br class="m_7772327218272418810gmail_msg">
<br class="m_7772327218272418810gmail_msg"></blockquote></div><br class="m_7772327218272418810gmail_msg"></div>
______________________________<wbr>_________________<br class="m_7772327218272418810gmail_msg">
erlang-questions mailing list<br class="m_7772327218272418810gmail_msg">
<a href="mailto:erlang-questions@erlang.org" class="m_7772327218272418810gmail_msg" target="_blank">erlang-questions@erlang.org</a><br class="m_7772327218272418810gmail_msg">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" class="m_7772327218272418810gmail_msg" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br class="m_7772327218272418810gmail_msg">
</blockquote></div>
</div><br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div></div>