[Mesa-stable] [Mesa-dev] [PATCH] glsl: avoid stack smashing when there are too many attributes

Ilia Mirkin imirkin at alum.mit.edu
Tue Mar 8 15:01:54 UTC 2016


On Tue, Mar 8, 2016 at 9:54 AM, Iago Toral <itoral at igalia.com> wrote:
> On Sun, 2016-03-06 at 12:21 -0500, Ilia Mirkin wrote:
>> This fixes a crash in
>>
>> dEQP-GLES3.functional.transform_feedback.array_element.separate.points.lowp_mat3x2
>>
>> and likely others. The vertex shader has > 16 input variables (without
>> explicit locations), which causes us to index outside of the to_assign
>> array.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> Cc: "11.1 11.2" <mesa-stable at lists.freedesktop.org>
>> ---
>>
>> Not sure if this is the right thing or whether we should be making the to_assign array dynamically resizable. This definitely fixes the crashes though.
>
> FWIW, I had sent a similar patch about a year ago to fix this:
> https://lists.freedesktop.org/archives/mesa-dev/2015-July/090121.html
>
> Not sure that it is any better...

Maybe a little? Sorry, didn't realize that a fix for this already
existed... using max_index is probably a little bit better? I've
already pushed my version, but feel free to do yours as a fixup. If
you guys have additional useful patches that have remained unreviewed,
it'd probably be good to ping people to review them every so often.
These things are quickly forgotten, and if the author(s) don't push
for inclusion, it will be lost forever.

  -ilia


More information about the mesa-stable mailing list