[Mesa-dev] [Bug 107954] radv_shader_compile_to_nir doesn't check for bad entry point

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Sep 16 19:26:06 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107954

            Bug ID: 107954
           Summary: radv_shader_compile_to_nir doesn't check for bad entry
                    point
           Product: Mesa
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Vulkan/radeon
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: freedesktop at treblig.org
        QA Contact: mesa-dev at lists.freedesktop.org

I screwed up my vulkan calling and ended up getting radv_shader_compile_to_nir
to seg because it has:

251 entry_point = spirv_to_nir(spirv, module->size / 4,
             spec_entries, num_spec_entries,
             stage, entrypoint_name,
             &spirv_options, &nir_options);
252 nir = entry_point->shader;
    assert(nir->info.stage == stage);

it's dereferencing 'entry_point' on 252, but if the caller screws up
entry_point can be NULL from spirv_to_nir;

Could this failure be made cleaner?

(Nothing else printed anything first before the seg by default;
spirv_to_nir took a bit of an odd route; it checks b->entry_point = NULL then
call vrn_fail that jumps back to it's setjmp handler and cleans up - so it's
not obvious to me why it also has a ralloc_free(b), return NULL if the vtn_fail
is going to take the setjmp).

My screwup incidentally was a cut-and-paste where I'd copied the code for my
vertex shader for my fragment shader and so I was trying to find the fragment
shader entrypoint in my vertex shader.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180916/5d6d9d6c/attachment.html>


More information about the mesa-dev mailing list