Opened 11 years ago
Closed 11 years ago
#2713 closed defect (fixed)
av_d2q regression on sparc64 and ia64
Reported by: | Carl Eugen Hoyos | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avutil |
Version: | git-master | Keywords: | regression ia64 sparc64 |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description (last modified by )
The parseutils fate test fails on sparc64 Linux and ia64 Linux since 64eacb8. The problem is not limited to parseutils, many fate tests fail because of an incorrect timebase.
The reason is that for some values of d and den - local variables in av_d2q() used when calling av_reduce() - (uint64_t)rint(d * den)
and llrint(d * den)
provide different results than (int64_t)(d * den + 0.5)
which was used before.
$ make fate-parseutils TEST parseutils --- ./tests/ref/fate/parseutils 2013-06-25 21:37:23.758635630 +0200 +++ tests/data/fate/parseutils 2013-06-25 21:40:36.629074659 +0200 @@ -6,7 +6,7 @@ '-123 / 0' -> -1/0 ERROR '' -> 0/0 ERROR '/' -> 0/0 ERROR -' 123 / 321' -> 41/107 OK +' 123 / 321' -> 213623/557504 OK 'foo/foo' -> 0/0 ERROR 'foo/1' -> 0/0 ERROR '1/foo' -> 1/0 ERROR @@ -17,13 +17,13 @@ '0' -> 0/1 ERROR '-123/123' -> -1/1 ERROR '-foo' -> 0/0 ERROR -'123.23' -> 12323/100 OK -'.23' -> 23/100 OK -'-.23' -> -23/100 ERROR -'-0.234' -> -117/500 ERROR +'123.23' -> 697112/5657 OK +'.23' -> 209687/911683 OK +'-.23' -> -209687/911683 ERROR +'-0.234' -> -177357/757936 ERROR '-0.0000001' -> -1/10000000 ERROR -' 21332.2324 ' -> 917286/43 OK -' -21332.2324 ' -> -917286/43 ERROR +' 21332.2324 ' -> 682631/32 OK +' -21332.2324 ' -> -682631/32 ERROR Testing av_parse_color() bikeshed -> R(80) G(64) B(140) A(59) Test parseutils failed. Look at tests/data/fate/parseutils.err for details. make: *** [fate-parseutils] Error 1
Not reproducible on ppc64.
Attachments (1)
Change History (10)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Description: | modified (diff) |
---|
comment:3 by , 11 years ago
Please provide exact information which variables have which values, including a patch that shows how you printed them
comment:4 by , 11 years ago
Replying to cehoyos:
The parseutils fate test fails on sparc64 Linux and ia64 Linux since 887d74c.
Sorry, it is actually a regression since 64eacb8.
comment:5 by , 11 years ago
Description: | modified (diff) |
---|
by , 11 years ago
Attachment: | patchrational.diff added |
---|
comment:6 by , 11 years ago
$ make fate-parseutils TEST parseutils --- ./tests/ref/fate/parseutils 2013-07-04 03:21:28.208764283 +0200 +++ tests/data/fate/parseutils 2013-07-04 03:39:26.316158816 +0200 @@ -6,24 +6,46 @@ '-123 / 0' -> -1/0 ERROR '' -> 0/0 ERROR '/' -> 0/0 ERROR -' 123 / 321' -> 41/107 OK +d: 0.383178, den: 2305843009213693952, d*den: 883547321287490176.000000, (int64_t)(d*den+0.5): 883547321287490176, rint(d*den): 883547321287490176.000000, +(uint64_t)rint(d*den): 883547321287490176, (int64_t)rint(d*den): 883547205323373184, llrint(d*den): 883547205323373184 +' 123 / 321' -> 213623/557504 OK 'foo/foo' -> 0/0 ERROR 'foo/1' -> 0/0 ERROR '1/foo' -> 1/0 ERROR '0/0' -> 0/0 ERROR '/0' -> 0/0 ERROR '1/' -> 1/0 ERROR +d: 1.000000, den: 2305843009213693952, d*den: 2305843009213693952.000000, (int64_t)(d*den+0.5): 2305843009213693952, rint(d*den): 2305843009213693952.000000, +(uint64_t)rint(d*den): 2305843009213693952, (int64_t)rint(d*den): 2305843009213693952, llrint(d*den): 2305843009213693952 '1' -> 1/1 OK +d: 0.000000, den: 2305843009213693952, d*den: 0.000000, (int64_t)(d*den+0.5): 0, rint(d*den): 0.000000, +(uint64_t)rint(d*den): 0, (int64_t)rint(d*den): 0, llrint(d*den): 0 '0' -> 0/1 ERROR +d: -1.000000, den: 2305843009213693952, d*den: -2305843009213693952.000000, (int64_t)(d*den+0.5): -2305843009213693952, rint(d*den): -2305843009213693952.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -2305843009213693952, llrint(d*den): -2305843009213693952 '-123/123' -> -1/1 ERROR '-foo' -> 0/0 ERROR -'123.23' -> 12323/100 OK -'.23' -> 23/100 OK -'-.23' -> -23/100 ERROR -'-0.234' -> -117/500 ERROR +d: 123.230000, den: 36028797018963968, d*den: 4439828656646929920.000000, (int64_t)(d*den+0.5): 4439828656646929920, rint(d*den): 4439828656646929920.000000, +(uint64_t)rint(d*den): 4439828656646929920, (int64_t)rint(d*den): 4439827956567260672, llrint(d*den): 4439827956567260672 +'123.23' -> 697112/5657 OK +d: 0.230000, den: 2305843009213693952, d*den: 530343892119149632.000000, (int64_t)(d*den+0.5): 530343892119149632, rint(d*den): 530343892119149632.000000, +(uint64_t)rint(d*den): 530343892119149632, (int64_t)rint(d*den): 530343664485882944, llrint(d*den): 530343664485882944 +'.23' -> 209687/911683 OK +d: -0.230000, den: 2305843009213693952, d*den: -530343892119149632.000000, (int64_t)(d*den+0.5): -530343892119149632, rint(d*den): -530343892119149632.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -530343664485882944, llrint(d*den): -530343664485882944 +'-.23' -> -209687/911683 ERROR +d: -0.234000, den: 2305843009213693952, d*den: -539567264156004416.000000, (int64_t)(d*den+0.5): -539567264156004416, rint(d*den): -539567264156004416.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -539567191141560384, llrint(d*den): -539567191141560384 +'-0.234' -> -177357/757936 ERROR +d: -0.000000, den: 2305843009213693952, d*den: -230584300921.369385, (int64_t)(d*den+0.5): -230584300920, rint(d*den): -230584300921.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -230584300921, llrint(d*den): -230584300921 '-0.0000001' -> -1/10000000 ERROR -' 21332.2324 ' -> 917286/43 OK -' -21332.2324 ' -> -917286/43 ERROR +d: 21332.232400, den: 140737488355328, d*den: 3002244808988150784.000000, (int64_t)(d*den+0.5): 3002244808988150784, rint(d*den): 3002244808988150784.000000, +(uint64_t)rint(d*den): 3002244808988150784, (int64_t)rint(d*den): 3002242889137769472, llrint(d*den): 3002242889137769472 +' 21332.2324 ' -> 682631/32 OK +d: -21332.232400, den: 140737488355328, d*den: -3002244808988150784.000000, (int64_t)(d*den+0.5): -3002244808988150784, rint(d*den): -3002244808988150784.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -3002242889137769472, llrint(d*den): -3002242889137769472 +' -21332.2324 ' -> -682631/32 ERROR Testing av_parse_color() bikeshed -> R(80) G(64) B(140) A(59) Test parseutils failed. Look at tests/data/fate/parseutils.err for details. make: *** [fate-parseutils] Error 1
follow-up: 8 comment:7 by , 11 years ago
This looks like a compiler bug or a bug in libc
which versions of these are used ?
Also please test nearbyint(), round(), floor(x + 0.5) and ceil(x - 0.5) too
comment:8 by , 11 years ago
Replying to michael:
This looks like a compiler bug or a bug in libc
which versions of these are used ?
ia64: gcc-4.4, gcc-4.5, gcc-4.6, gcc-4.7 (works fine with icc), Debian EGLIBC 2.17-5
sparc64: gcc-4.2, gcc-4.4, gcc-4.6, Debian EGLIBC 2.13-38
Also please test nearbyint(), round(), floor(x + 0.5) and ceil(x - 0.5) too
All four alternatives pass fate on both systems.
$ make fate-parseutils TEST parseutils --- ./tests/ref/fate/parseutils 2013-07-04 03:21:28.208764283 +0200 +++ tests/data/fate/parseutils 2013-07-04 14:48:50.008046808 +0200 @@ -6,24 +6,68 @@ '-123 / 0' -> -1/0 ERROR '' -> 0/0 ERROR '/' -> 0/0 ERROR -' 123 / 321' -> 41/107 OK +d: 0.383178, den: 2305843009213693952, d*den: 883547321287490176.000000, (int64_t)(d*den+0.5): 883547321287490176, rint(d*den): 883547321287490176.000000, +(uint64_t)rint(d*den): 883547321287490176, (int64_t)rint(d*den): 883547205323373184, llrint(d*den): 883547205323373184 +nearbyint(d*den): 883547321287490176.000000, (int64_t)nearbyint(d*den): 883547321287490176, round(d*den): 883547321287490176.000000, (int64_t)round(d*den): 883547321287490176 +floor(d*den+0.5): 883547321287490176.000000, (int64_t)floor(d*den+0.5): 883547321287490176, ceil(d*den-0.5): 883547321287490176.000000, (int64_t)ceil(d*den-0.5): 883547321287490176 +' 123 / 321' -> 213623/557504 OK 'foo/foo' -> 0/0 ERROR 'foo/1' -> 0/0 ERROR '1/foo' -> 1/0 ERROR '0/0' -> 0/0 ERROR '/0' -> 0/0 ERROR '1/' -> 1/0 ERROR +d: 1.000000, den: 2305843009213693952, d*den: 2305843009213693952.000000, (int64_t)(d*den+0.5): 2305843009213693952, rint(d*den): 2305843009213693952.000000, +(uint64_t)rint(d*den): 2305843009213693952, (int64_t)rint(d*den): 2305843009213693952, llrint(d*den): 2305843009213693952 +nearbyint(d*den): 2305843009213693952.000000, (int64_t)nearbyint(d*den): 2305843009213693952, round(d*den): 2305843009213693952.000000, (int64_t)round(d*den): 2305843009213693952 +floor(d*den+0.5): 2305843009213693952.000000, (int64_t)floor(d*den+0.5): 2305843009213693952, ceil(d*den-0.5): 2305843009213693952.000000, (int64_t)ceil(d*den-0.5): 2305843009213693952 '1' -> 1/1 OK +d: 0.000000, den: 2305843009213693952, d*den: 0.000000, (int64_t)(d*den+0.5): 0, rint(d*den): 0.000000, +(uint64_t)rint(d*den): 0, (int64_t)rint(d*den): 0, llrint(d*den): 0 +nearbyint(d*den): 0.000000, (int64_t)nearbyint(d*den): 0, round(d*den): 0.000000, (int64_t)round(d*den): 0 +floor(d*den+0.5): 0.000000, (int64_t)floor(d*den+0.5): 0, ceil(d*den-0.5): -0.000000, (int64_t)ceil(d*den-0.5): 0 '0' -> 0/1 ERROR +d: -1.000000, den: 2305843009213693952, d*den: -2305843009213693952.000000, (int64_t)(d*den+0.5): -2305843009213693952, rint(d*den): -2305843009213693952.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -2305843009213693952, llrint(d*den): -2305843009213693952 +nearbyint(d*den): -2305843009213693952.000000, (int64_t)nearbyint(d*den): -2305843009213693952, round(d*den): -2305843009213693952.000000, (int64_t)round(d*den): -2305843009213693952 +floor(d*den+0.5): -2305843009213693952.000000, (int64_t)floor(d*den+0.5): -2305843009213693952, ceil(d*den-0.5): -2305843009213693952.000000, (int64_t)ceil(d*den-0.5): -2305843009213693952 '-123/123' -> -1/1 ERROR '-foo' -> 0/0 ERROR -'123.23' -> 12323/100 OK -'.23' -> 23/100 OK -'-.23' -> -23/100 ERROR -'-0.234' -> -117/500 ERROR +d: 123.230000, den: 36028797018963968, d*den: 4439828656646929920.000000, (int64_t)(d*den+0.5): 4439828656646929920, rint(d*den): 4439828656646929920.000000, +(uint64_t)rint(d*den): 4439828656646929920, (int64_t)rint(d*den): 4439827956567260672, llrint(d*den): 4439827956567260672 +nearbyint(d*den): 4439828656646929920.000000, (int64_t)nearbyint(d*den): 4439828656646929920, round(d*den): 4439828656646929920.000000, (int64_t)round(d*den): 4439828656646929920 +floor(d*den+0.5): 4439828656646929920.000000, (int64_t)floor(d*den+0.5): 4439828656646929920, ceil(d*den-0.5): 4439828656646929920.000000, (int64_t)ceil(d*den-0.5): 4439828656646929920 +'123.23' -> 697112/5657 OK +d: 0.230000, den: 2305843009213693952, d*den: 530343892119149632.000000, (int64_t)(d*den+0.5): 530343892119149632, rint(d*den): 530343892119149632.000000, +(uint64_t)rint(d*den): 530343892119149632, (int64_t)rint(d*den): 530343664485882944, llrint(d*den): 530343664485882944 +nearbyint(d*den): 530343892119149632.000000, (int64_t)nearbyint(d*den): 530343892119149632, round(d*den): 530343892119149632.000000, (int64_t)round(d*den): 530343892119149632 +floor(d*den+0.5): 530343892119149632.000000, (int64_t)floor(d*den+0.5): 530343892119149632, ceil(d*den-0.5): 530343892119149632.000000, (int64_t)ceil(d*den-0.5): 530343892119149632 +'.23' -> 209687/911683 OK +d: -0.230000, den: 2305843009213693952, d*den: -530343892119149632.000000, (int64_t)(d*den+0.5): -530343892119149632, rint(d*den): -530343892119149632.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -530343664485882944, llrint(d*den): -530343664485882944 +nearbyint(d*den): -530343892119149632.000000, (int64_t)nearbyint(d*den): -530343892119149632, round(d*den): -530343892119149632.000000, (int64_t)round(d*den): -530343892119149632 +floor(d*den+0.5): -530343892119149632.000000, (int64_t)floor(d*den+0.5): -530343892119149632, ceil(d*den-0.5): -530343892119149632.000000, (int64_t)ceil(d*den-0.5): -530343892119149632 +'-.23' -> -209687/911683 ERROR +d: -0.234000, den: 2305843009213693952, d*den: -539567264156004416.000000, (int64_t)(d*den+0.5): -539567264156004416, rint(d*den): -539567264156004416.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -539567191141560384, llrint(d*den): -539567191141560384 +nearbyint(d*den): -539567264156004416.000000, (int64_t)nearbyint(d*den): -539567264156004416, round(d*den): -539567264156004416.000000, (int64_t)round(d*den): -539567264156004416 +floor(d*den+0.5): -539567264156004416.000000, (int64_t)floor(d*den+0.5): -539567264156004416, ceil(d*den-0.5): -539567264156004416.000000, (int64_t)ceil(d*den-0.5): -539567264156004416 +'-0.234' -> -177357/757936 ERROR +d: -0.000000, den: 2305843009213693952, d*den: -230584300921.369385, (int64_t)(d*den+0.5): -230584300920, rint(d*den): -230584300921.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -230584300921, llrint(d*den): -230584300921 +nearbyint(d*den): -230584300921.000000, (int64_t)nearbyint(d*den): -230584300921, round(d*den): -230584300921.000000, (int64_t)round(d*den): -230584300921 +floor(d*den+0.5): -230584300921.000000, (int64_t)floor(d*den+0.5): -230584300921, ceil(d*den-0.5): -230584300921.000000, (int64_t)ceil(d*den-0.5): -230584300921 '-0.0000001' -> -1/10000000 ERROR -' 21332.2324 ' -> 917286/43 OK -' -21332.2324 ' -> -917286/43 ERROR +d: 21332.232400, den: 140737488355328, d*den: 3002244808988150784.000000, (int64_t)(d*den+0.5): 3002244808988150784, rint(d*den): 3002244808988150784.000000, +(uint64_t)rint(d*den): 3002244808988150784, (int64_t)rint(d*den): 3002242889137769472, llrint(d*den): 3002242889137769472 +nearbyint(d*den): 3002244808988150784.000000, (int64_t)nearbyint(d*den): 3002244808988150784, round(d*den): 3002244808988150784.000000, (int64_t)round(d*den): 3002244808988150784 +floor(d*den+0.5): 3002244808988150784.000000, (int64_t)floor(d*den+0.5): 3002244808988150784, ceil(d*den-0.5): 3002244808988150784.000000, (int64_t)ceil(d*den-0.5): 3002244808988150784 +' 21332.2324 ' -> 682631/32 OK +d: -21332.232400, den: 140737488355328, d*den: -3002244808988150784.000000, (int64_t)(d*den+0.5): -3002244808988150784, rint(d*den): -3002244808988150784.000000, +(uint64_t)rint(d*den): -9223372036854775808, (int64_t)rint(d*den): -3002242889137769472, llrint(d*den): -3002242889137769472 +nearbyint(d*den): -3002244808988150784.000000, (int64_t)nearbyint(d*den): -3002244808988150784, round(d*den): -3002244808988150784.000000, (int64_t)round(d*den): -3002244808988150784 +floor(d*den+0.5): -3002244808988150784.000000, (int64_t)floor(d*den+0.5): -3002244808988150784, ceil(d*den-0.5): -3002244808988150784.000000, (int64_t)ceil(d*den-0.5): -3002244808988150784 +' -21332.2324 ' -> -682631/32 ERROR Testing av_parse_color() bikeshed -> R(80) G(64) B(140) A(59) Test parseutils failed. Look at tests/data/fate/parseutils.err for details.
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Here is one example (of many) for an incorrect timebase in fate: