<html>
    <head>
      <base href="https://bugs.freedesktop.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 - [d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91039">91039</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xamaniqinqu@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description: 
The "Nine" D3D9 state tracker crashes when Wine loads any D3D program if Mesa
is compiled with -mfpmath=sse. This is because the Linux ABI assumes a stack
alignment to 16 bytes, whereas the Win32 ABI assumes a stack alignment to 4
bytes. This causes a stack misalignment and thus a general protection fault.


Additional information: 
Also see the following external bug reports:

<a href="https://bugs.winehq.org/show_bug.cgi?id=22475">https://bugs.winehq.org/show_bug.cgi?id=22475</a>
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838</a>


Specifications:
OS: Gentoo GNU/Linux x86_64
Kernel version: Linux 4.0.4-hardened-r3
Mesa version: 10.6.0


Solution:
The crashes no longer occur when Mesa's stack is realigned to 4 bytes.
Therefore, always pass -mstackrealign to CFLAGS if -mfpmath=sse is enabled;
this should probably be handled in the configure script.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>