<div dir="ltr"><div dir="ltr">Am Di., 29. Okt. 2019 um 07:07 Uhr schrieb Björn Gustavsson <<a href="mailto:bjorn@erlang.org">bjorn@erlang.org</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Mon, Oct 28, 2019 at 4:39 PM Andreas Schultz <<a href="mailto:andreas.schultz@travelping.com" target="_blank">andreas.schultz@travelping.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Am Mo., 28. Okt. 2019 um 15:22 Uhr schrieb Björn Gustavsson <<a href="mailto:bjorn@erlang.org" target="_blank">bjorn@erlang.org</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks for reporting this issue.<br>
<br>
We have investigated the issue and found that it is a bug in the compiler.<br></blockquote><div><br></div><div>wow. I have to say I'm a bit scared of OTP 22.x at the moment because of all the "bugs in the compiler" changes lately.</div><div>Did the rewrite of the compiler in 22.0 cause all this or was it present before and just went unnoticed?</div></div></div></blockquote><div><br></div><div>It is a new bug in OTP 22. This particular</div><div>bug was in the new optimization pass for</div><div>optimizing receives.</div><div><br></div><div>There are more details in our blog, but the short</div><div>story is that we had reached a dead end in the</div><div>compiler and that it was very time consuming</div><div>and error prone to add new optimizations to</div><div>the compiler.</div></div></div></div></div></blockquote><div><br></div><div>I'm sure that over time all the benefits of the new compiler architecture are well worth the price.</div><div>But for OTP 22.x it has led to a few, but highly frustrating problems. Even the few incorrect code generation bugs have led to very hard to understand problems for the users.</div><div><br></div><div>I'm not sure that scope and impact of this bug here is even fully understood.</div><div><br></div><div>My demonstration code used a bare receive, but the code that actually triggered it used a plain gen_server. The result of the bug was that gen_sever:calls seemed to arrive extremely late (multiple seconds).</div><div>It would therefore seem that the incorrect code was present in main receive loop of gen_server (and probably also gen_statem and gen_event). This would mean almost all Erlang applications on OTP 22.x could be affected.</div><div><br></div><div>The effects might go unnoticed in many tests cases in other projects, until it causes unexplainable failures.</div><div><br></div><div>Since all this was introduced in OTP 22, the sensible suggestion for everyone seem to be test OTP 22.x as well as they can, but to stay away from it for production use.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div>Most of the reported compiler bugs in OTP 22<br></div><div>was of the kind that causes the compiler to crash.</div><div>Those bugs are annoying but basically harmless in </div><div>that they can't subtly change the meaning of your</div><div>program. Unfortunately, a few bugs were of the kind</div><div>that the compiler generated incorrect code.</div><div><br></div><div>Moving forward, the new compiler architecture</div><div>will give us a solid ground for further improvements</div><div>of the compiler.</div></div></div></div></div></blockquote><div><br></div><div>I'm sure it will and I'm sure the current pain is well worth it.</div><div><br></div><div>Regards,</div><div>Andreas</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>/Björn</div><div><br></div><div><br></div></div>-- <br><div dir="ltr"><div dir="ltr">Björn Gustavsson, Erlang/OTP, Ericsson AB<br></div></div></div></div></div>
</blockquote></div><div><br></div></div>