Summary: | Incorrect/undefined behavior from shifting an integer too far | ||
---|---|---|---|
Product: | Mesa | Reporter: | Bruce Dawson <brucedawson> |
Component: | Drivers/DRI/swrast | Assignee: | mesa-dev |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | patch to fix the issues in s_span.c |
Description
Bruce Dawson
2014-12-09 06:12:37 UTC
(In reply to Bruce Dawson from comment #0) > drivers\dri\i965\brw_fs.cpp(2164): > for (int i = 0; i < FRAG_ATTRIB_MAX; i++) { > if (!(fp->Base.InputsRead & BITFIELD64_BIT(i))) > continue; > > if (prog->Name == 0) > key.proj_attrib_mask |= 1 << i; // BUG This doesn't exist in the code base. In fact, the proj_attrib_mask field was removed in April 2013! (commit 705c8247) I'm marking as WONTFIX, because there's no ALREADYFIX and bugzilla isn't configured to allow OBSOLETE statuses. I haven't checked whether the other two are still present. Please just submit fixes directly to the mailing list. Created attachment 110683 [details] [review] patch to fix the issues in s_span.c Hi Bruce! Long time no see (err, email). Here's a patch which I believe will fix the issues in s_span.c. I think I've actually seen warnings about that in the past. But the swrast code is pretty old and not used much anymore so it hasn't been a high priority. Can you apply the patch and see if that resolves the warnings you saw? Thanks. (In reply to Brian Paul from comment #2) > Created attachment 110683 [details] [review] [review] > patch to fix the issues in s_span.c > > Hi Bruce! Long time no see (err, email). > > Here's a patch which I believe will fix the issues in s_span.c. I think > I've actually seen warnings about that in the past. But the swrast code is > pretty old and not used much anymore so it hasn't been a high priority. > > Can you apply the patch and see if that resolves the warnings you saw? > > Thanks. Hi Brian -- last seen in Hawaii I believe? Small world. Our version of mesa seems to be extremely old, predating the rename from FRAG_ATTRIB_MAX to VARYING_SLOT_MAX, so I can't apply the patch, but I took a look at it. I don't understand the first fix where you change the loop range to SPAN_NUM_ATTRIBS. That seems orthogonal. It seems that the (1 << i) still needs updating. The second fix looks good. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/314. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.