Bug 67411 - lp_bld_conv.c:757:lp_build_conv: Assertion `dst_type.sign || dst_type.width < 32' failed.
Summary: lp_bld_conv.c:757:lp_build_conv: Assertion `dst_type.sign || dst_type.width <...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) All
: medium critical
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: have-backtrace, regression
Depends on:
Blocks:
 
Reported: 2013-07-27 19:41 UTC by Vinson Lee
Modified: 2013-07-29 11:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-07-27 19:41:41 UTC
mesa: 803f755edeabd1b0af3d8f4ebf2005333e152ad4 (master)

Run lp_test_conv unit test.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000000100004451 in _debug_assert_fail (expr=0x1009c09b4 "dst_type.sign || dst_type.width < 32", file=0x1009c085b "src/gallium/auxiliary/gallivm/lp_bld_conv.c", line=757, function=0x1009c08fd "lp_build_conv") at src/gallium/auxiliary/util/u_debug.c:278
278	      os_abort();
(gdb) bt
#0  0x0000000100004451 in _debug_assert_fail (expr=0x1009c09b4 "dst_type.sign || dst_type.width < 32", file=0x1009c085b "src/gallium/auxiliary/gallivm/lp_bld_conv.c", line=757, function=0x1009c08fd "lp_build_conv") at src/gallium/auxiliary/util/u_debug.c:278
#1  0x00000001000818f6 in lp_build_conv (gallivm=0x100f03eb0, src_type={floating = 1, fixed = 0, sign = 1, norm = 0, width = 32, length = 4}, dst_type={floating = 0, fixed = 1, sign = 0, norm = 0, width = 32, length = 4}, src=0x7fff5fbfc4c0, num_srcs=1, dst=0x7fff5fbfc3c0, num_dsts=1) at src/gallium/auxiliary/gallivm/lp_bld_conv.c:757
#2  0x0000000100001efe in add_conv_test (gallivm=0x100f03eb0, src_type={floating = 1, fixed = 0, sign = 1, norm = 0, width = 32, length = 4}, num_srcs=1, dst_type={floating = 0, fixed = 1, sign = 0, norm = 0, width = 32, length = 4}, num_dsts=1) at src/gallium/drivers/llvmpipe/lp_test_conv.c:135
#3  0x000000010000120c in test_one (verbose=0, fp=0x0, src_type={floating = 1, fixed = 0, sign = 1, norm = 0, width = 32, length = 4}, dst_type={floating = 0, fixed = 1, sign = 0, norm = 0, width = 32, length = 4}) at src/gallium/drivers/llvmpipe/lp_test_conv.c:216
#4  0x0000000100001c13 in test_some (verbose=0, fp=0x0, n=1000) at src/gallium/drivers/llvmpipe/lp_test_conv.c:431
#5  0x00000001000036ab in main (argc=1, argv=0x7fff5fbff540) at src/gallium/drivers/llvmpipe/lp_test_main.c:411
Current language:  auto; currently minimal
(gdb) frame 1
#1  0x00000001000818f6 in lp_build_conv (gallivm=0x100f03eb0, src_type={floating = 1, fixed = 0, sign = 1, norm = 0, width = 32, length = 4}, dst_type={floating = 0, fixed = 1, sign = 0, norm = 0, width = 32, length = 4}, src=0x7fff5fbfc4c0, num_srcs=1, dst=0x7fff5fbfc3c0, num_dsts=1) at src/gallium/auxiliary/gallivm/lp_bld_conv.c:757
757	         assert(dst_type.sign || dst_type.width < 32);
(gdb) print dst_type
$1 = {
  floating = 0,
  fixed = 1,
  sign = 0,
  norm = 0,
  width = 32,
  length = 4
}
(gdb) print dst_type
$2 = {
  floating = 0,
  fixed = 1,
  sign = 0,
  norm = 0,
  width = 32,
  length = 4
}


8c3d3622d9ce2fd2a8f46084ab8153d708fa5b09 is the first bad commit
commit 8c3d3622d9ce2fd2a8f46084ab8153d708fa5b09
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jul 27 03:53:00 2013 +0200

    gallivm: fix float->SNORM conversion

    Just like the UNORM case we need to use round to nearest, not trunc.
    (There's also another problem, we're using the formula for SNORM->float
    which will produce a value below -1.0 for the most negative value which
    according to both OpenGL and d3d10 would need clamping. However, no actual
    failures have been observed due to that hence keep cheating on that.)

    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

:040000 040000 d0b0cbcbcf8f82cc2e0e51e51124a6068114feac 3273dc6ce19e22a8bf7e21dc7534a36c95c4f96d M      src
Comment 1 Roland Scheidegger 2013-07-29 11:25:05 UTC
Hmm ok I got rid of the assert again. As far as I can tell the code never could work for some float->uint conversions (for numbers between 2^31 and 2^32) and will continue to work incorrectly, just the assertion was new really.
Fixed by e08114fed723ff5a873d2a3f6682c1c074574458


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.