Bug 610785
Summary: | GCC pointer indexing bug [was: cvCanny crashes on 64 bit systems] | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | markus.moll |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 13 | CC: | ian.cullinan, jakub, karlthered, kwizart, madrenegade, markus.moll, michael.mathieu, nomis80, rpandit |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 531695 | Environment: | |
Last Closed: | 2010-07-09 14:34:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
markus.moll
2010-07-02 12:59:32 UTC
Yes, this looks like a bug in ivopts handling, probably a latent bug uncovered by the backport of the http://gcc.gnu.org/PR34163 changes: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149207 http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155288 Small self-contained testcase which works with -O0/-O1 and when compiled with gcc also with -O2/-O3, but fails with g++ at -O2/-O3. Temporary workaround -fno-ivopts. struct S { int s; }; struct T { int w; int h; }; int vr; inline struct T bar (const struct S * x) { struct T t; t.w = vr; t.h = x->s; return t; } __attribute__ ((noinline)) void foo (struct S * w, unsigned char *x, int y, int *z[2]) { struct T t; int i, j, k; t = bar (w); k = t.w + 2; for (i = 0; i <= t.h; i++) { int *u = z[i > 0] + 1; unsigned char *v; int q = 0; v = x + k * i + 1; for (j = 0; j < t.w; j++) { int m = u[j]; if (m > y && !q && v[j - k] != 2) v[j] = 0; } } } unsigned char b[64]; int main (void) { int v[32], *z[2]; struct S s; __builtin_memset (v, 0, sizeof (v)); vr = 16; s.s = 16; z[0] = v; z[1] = v; foo (&s, b + 32, -1, z); return 0; } Should be fixed in gcc-4.4.4-11.fc{12,13}. (In reply to comment #2) > Should be fixed in gcc-4.4.4-11.fc{12,13}. Can you also mark the original bug (#531695) as a duplicate and close that as well? No, because while the fix is in gcc-4.4.4-11, it will take some time before that gcc is pushed as errata (especially because gcc-4.4.4-10 has been released as errata a few days ago - there needs to be some time to accumulate further bugfixes), and afterwards opencv needs to be rebuilt with that gcc. |