<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - displaying some long double values causes lldb to crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=35860">35860</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>displaying some long double values causes lldb to crash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>oliver@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If I have something along the lines of:

  union {
    struct {
      int x;
      int y;
      int node_index;
    } as_point;
    long double as_number;
  } data;
  data.as_point.x = 0;
  data.as_point.y = 0;
  data.as_point.node_index = 512;

and pause after assigning to node_index, then try to display the struct:

p data

lldb crashes. I've reduced this to the problem being the display of the long
double, specifically it seems to be going wrong when the mantissa is zero but
the exponent in non-zero. Given the wonkiness of long double on x86 I assume
this is incorrect handling of a denormal (pseudo-denormal? I was reading some
of the docs on it and that appears to be a thing #wat).

It's a real problem in Xcode as Xcode auto displays the values of all locals
and so lldb crashes whenever this happens. I can work around this if I know it
may happen in a given function by manually setting the display type to
hex/binary/anything-other-than-default.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>