<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:danylo.piliaiev@gmail.com" title="Danylo <danylo.piliaiev@gmail.com>"> <span class="fn">Danylo</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - System hang when use glTexImage3D to specify a 3D texture image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104760">bug 104760</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>danylo.piliaiev@gmail.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - System hang when use glTexImage3D to specify a 3D texture image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104760#c17">Comment # 17</a>
              on <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - System hang when use glTexImage3D to specify a 3D texture image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104760">bug 104760</a>
              from <span class="vcard"><a class="email" href="mailto:danylo.piliaiev@gmail.com" title="Danylo <danylo.piliaiev@gmail.com>"> <span class="fn">Danylo</span></a>
</span></b>
        <pre>Kernel was bisected to commit 40e62d5d6be8b4999068da31ee6aca7ca76669ee:
 drm/i915: Acquire the backing storage outside of struct_mutex in set-domain
 <a href="https://patchwork.freedesktop.org/patch/119012/">https://patchwork.freedesktop.org/patch/119012/</a>

It seems that before that patch memory wasn't immediately allocated but I could
be wrong.
Also it seems that OOM killer doesn't know about such allocations and doesn't
kill example application until the very end.

However why are we even able to request such a big allocation when creating a
texture?
There is a Const.MaxTextureMbytes, checking against which should prevent
creation of such texture.

i965 doesn't provide custom TestProxyTexImage and uses
_mesa_test_proxy_teximage which doesn't take 'level' into account so the
texture with dimensions of 1x1x1 and level=11 easily passes the check.

Later in intel_miptree_create_for_teximage the dimensions of the image at level
0 are determined to be 2048x2048x2048 but at this moment there are no checks of
resulting image size.

The solution to this may be a creation of custom TestProxyTexImage where the
size of the image at level 0 will be checked. So the texture size will always
obey the limits.

Also I found that in radeon_miptree_create_for_teximage there are special
checks for height and depth being 1, in such case they will be 1 at all levels.
Just an observation...

To sum up:

- One issue is that texture size limit is enforced inconsistently and it can be
fixed in Mesa.
- Second is OOM killer being unable to cope with this type of allocations. I
don't have any knowledge about this one.</pre>
        </div>
      </p>


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

      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>