<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">The `--enable-builtin-zlib` flag also fixes strange xref/dialyzer bugs in one of our projects built on top of Erlang 17.5 on High Sierra.<div class=""><br class=""></div><div class="">Thanks for sharing! :)</div><div class=""><div class="">
<div class=""><div style="orphans: 2; widows: 2;" class=""><div class="">---</div><div class="">Best regards,</div><div class="">Sergey Yelin.</div></div><div style="orphans: 2; widows: 2;" class=""><br class=""></div></div><br class="Apple-interchange-newline">

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 14 Nov 2017, at 10:30, Jan Chochol <<a href="mailto:jan.chochol@gooddata.com" class="">jan.chochol@gooddata.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Martin,<div class=""><br class=""></div><div class="">This is bug with combination of new zlib and old Erlang - <a href="https://github.com/erlang/otp/commit/e27119948fc6ab28bea81019720bddaac5b655a7" class="">https://github.com/erlang/otp/commit/e27119948fc6ab28bea81019720bddaac5b655a7</a> .</div><div class="">It is fixed in OTP-18.3.4.5 and newer.</div><div class="">"--enable-builtin-zlib" works, because it uses older bundled zlib.<br class=""></div><div class=""><br class=""></div><div class="">Jan</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Nov 13, 2017 at 10:01 PM, Martin Sumner <span dir="ltr" class=""><<a href="mailto:martin.sumner@gmail.com" target="_blank" class="">martin.sumner@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Rather foolishly I accepted the upgrade to High Sierra on my Macbook last night.  This has led to an interesting problem with a binary_to_term line on my project.<div class=""><br class=""></div><div class="">Following the upgrade, tests have started failing on this line:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/martinsumner/leveled/blob/master/src/leveled_sst.erl#L875" target="_blank" class="">https://github.com/<wbr class="">martinsumner/leveled/blob/<wbr class="">master/src/leveled_sst.erl#<wbr class="">L875</a><br class=""></div><div class=""><br class=""></div><div class="">with error:badarg being thrown.</div><div class=""><br class=""></div><div class="">However if I copy and paste the binary on which the badarg has been thrown out of the crash report, and into a erlang console - binary_to_term works just fine.</div><div class=""><br class=""></div><div class="">See this issue for an example - <a href="https://github.com/martinsumner/leveled/issues/106" target="_blank" class="">https://github.com/<wbr class="">martinsumner/leveled/issues/<wbr class="">106</a></div><div class=""><br class=""></div><div class="">This failure is intermittent, and indeed wrapping the binary_to_term like this is enough to make the problem seemingly disappear:</div><div class=""><br class=""></div><div class="">try binary_to_term(Bin) of</div><div class="">    T -> </div><div class="">        T</div><div class="">catch</div><div class="">    error:badarg -></div><div class="">        binary_to_term(Bin)</div><div class="">end.</div><div class=""><br class=""></div><div class="">Re-running the tests on another OSX device on a release previous to High Sierra shows no issues with/without the wrapper.</div><div class=""><br class=""></div><div class="">The problem appears to consistently exist in OTP 17.5 and 18.3.  However, running the tests in 19.3 and R16B02-basho10 doesn't show the problem.</div><div class=""><br class=""></div><div class="">The terms in question have all been compressed using term_to_binary's zlib compression.</div><div class=""><br class=""></div><div class="">If I build 18.3 on High Sierra with the  "--enable-builtin-zlib" option, the problem does *not* re-occur.  This switch appears to be a reliable delta between having and not having the problem, and I believe may have become the default in OTP 17. </div><div class=""><br class=""></div><div class="">It appears to be specific to v17/v18 Erlang with compressed terms, on High Sierra where the OS zlib implementation is used, not the inbuilt OTP zlib.</div><div class=""><br class=""></div><div class="">There appears to be internet chatter of other issues with Mac OSX High Sierra and changes to the zlib implementation - <a href="https://github.com/madler/zlib/issues/305" target="_blank" class="">https://github.com/madler/<wbr class="">zlib/issues/305</a>.</div><div class=""><br class=""></div><div class="">So I think this doesn't look like it is an Erlang issue, but I suspect it may not be resolved in High Sierra any time soon, and may impact other Erlang users using zlib functionality.  Does this it seem reasonable to pass this off as a High Sierra zlib bug, and use the --enable-builtin-zlib workaround?  If this is the case I'm not sure why I don't get the issue on 19.3, any ideas as to why?</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Martin </div><div class=""><br class=""></div><div class=""><br class=""></div></font></span></div>
<br class="">______________________________<wbr class="">_________________<br class="">
erlang-questions mailing list<br class="">
<a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank" class="">http://erlang.org/mailman/<wbr class="">listinfo/erlang-questions</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">erlang-questions mailing list<br class=""><a href="mailto:erlang-questions@erlang.org" class="">erlang-questions@erlang.org</a><br class="">http://erlang.org/mailman/listinfo/erlang-questions<br class=""></div></blockquote></div><br class=""></div></body></html>