Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1076

Unsafe receive optimization causes bug in socket.erl

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 22.1
    • Fix Version/s: None
    • Component/s: compiler, erts
    • Labels:
      None

      Description

      The compiler does an unsafe optimization of the code of the following lines in socket:

      https://github.com/erlang/otp/blob/f3e3ceb55/erts/preloaded/src/socket.erl#L2207-L2239

      The compiler will apply the optimization that avoids scanning the entire message. In this function, the optimization is unsafe because the receive marker will be set, but the function can return without entering the receive.

      This optimization causes the bug in socket described by this email to Erlang Questions:

      http://erlang.org/pipermail/erlang-questions/2019-October/098591.html

        Attachments

          Activity

            People

            Assignee:
            john John Högberg
            Reporter:
            bjorn Björn Gustavsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: