Bug 42635

Summary: [swrast] main/renderbuffer.c:1731: _mesa_map_soft_renderbuffer: Assertion `rb->Data' failed.
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: Eric Anholt <eric>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: medium CC: brianp
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2011-11-05 23:34:12 UTC
mesa: adb7f1351e4c231184a6355573c01c7780135342 (master)

Run piglit fdo10370 on swrast.

$ ./bin/fdo10370 -auto
Mesa: Initializing x86-64 optimizations
fdo10370: main/renderbuffer.c:1731: _mesa_map_soft_renderbuffer: Assertion `rb->Data' failed.
Aborted (core dumped)

(gdb) bt
#0  0x00007f18b5f14ba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f18b5f186b0 in abort () at abort.c:92
#2  0x00007f18b5f0da71 in __assert_fail (assertion=0x7f18b76270a8 "rb->Data", file=<value optimized out>, 
    line=1731, function=0x7f18b76279d0 "_mesa_map_soft_renderbuffer") at assert.c:81
#3  0x00007f18b739034a in _mesa_map_soft_renderbuffer (ctx=0x1b6f020, rb=0x1d4eb20, x=0, y=0, w=1, h=1, 
    mode=1, out_map=0x7fff470de8b8, out_stride=0x7fff470de8d8) at main/renderbuffer.c:1731
#4  0x00007f18b75d0e14 in slow_read_rgba_pixels (ctx=0x1b6f020, x=0, y=0, width=1, height=1, format=6408, 
    type=5126, pixels=0x603190, packing=0x7fff470de9c0, transferOps=2048) at swrast/s_readpix.c:247
#5  0x00007f18b75d0ffc in read_rgba_pixels (ctx=0x1b6f020, x=0, y=0, width=1, height=1, format=6408, 
    type=5126, pixels=0x603190, packing=0x7fff470de9c0) at swrast/s_readpix.c:296
#6  0x00007f18b75d1a5c in _swrast_ReadPixels (ctx=0x1b6f020, x=0, y=0, width=1, height=1, format=6408, 
    type=5126, packing=0x1b7e8b8, pixels=0x603190) at swrast/s_readpix.c:508
#7  0x00007f18b738b898 in _mesa_ReadnPixelsARB (x=0, y=0, width=1, height=1, format=6408, type=5126, 
    bufSize=2147483647, pixels=0x603190) at main/readpix.c:269
#8  0x00007f18b738b8f9 in _mesa_ReadPixels (x=0, y=0, width=1, height=1, format=6408, type=5126, 
    pixels=0x603190) at main/readpix.c:277
#9  0x000000000040162e in display () at piglit/tests/bugs/fdo10370.c:85
#10 0x00007f18b6d59e0d in ?? () from /usr/lib/libglut.so.3
#11 0x00007f18b6d5d9f9 in fgEnumWindows () from /usr/lib/libglut.so.3
#12 0x00007f18b6d5a2d2 in glutMainLoopEvent () from /usr/lib/libglut.so.3
#13 0x00007f18b6d5ac67 in glutMainLoop () from /usr/lib/libglut.so.3
#14 0x0000000000401b40 in main (argc=2, argv=0x7fff470def48)
    at piglit/tests/bugs/fdo10370.c:170
(gdb) frame 3
#3  0x00007f18b739034a in _mesa_map_soft_renderbuffer (ctx=0x1b6f020, rb=0x1d4eb20, x=0, y=0, w=1, h=1, 
    mode=1, out_map=0x7fff470de8b8, out_stride=0x7fff470de8d8) at main/renderbuffer.c:1731
1731	   ASSERT(rb->Data);
(gdb) print rb->Data
$1 = (GLvoid *) 0x0
Comment 1 Vinson Lee 2011-11-05 23:56:36 UTC
345fc4161967f15fb80848cd7dc6a63100f8c12d is the first bad commit
commit 345fc4161967f15fb80848cd7dc6a63100f8c12d
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Oct 12 17:05:20 2011 -0700

    swrast: Convert color glReadPixels slow path to using MapRenderbuffer.
    
    This may be a bit slower than before because we're switching from
    per-format compiled loops in GetRow to
    _mesa_unpack_rgba_block_unpack's loop around a callback to unpack a
    pixel.  The solution there would be to make _mesa_unpack_rgba_block
    fold the span loop into the format handlers.
    
    (On the other hand, function call overhead will hardly matter if
    MapRenderbuffer means the driver gets the data into cacheable memory
    instead of uncached).
    
    The adjust_colors code should no longer be required, since the unpack
    function does the 565 to float conversion in a single pass instead of
    converting it (poorly) through 8888 as apparently happened in the
    past.
    
    Reviewed-by: Brian Paul <brianp@vmware.com>

:040000 040000 cc580717701b9d8d90bc5371d7bde9ffae278cf3 54f18f68df28277cb8daacb30591f76bbb950d52 M	src
bisect run success
Comment 2 Vinson Lee 2011-11-11 14:09:34 UTC
mesa: bf8ad170c5af58fe9f49b3ce0f92c4eda9e5d845 (master)

Retested. This regression is still present.
Comment 3 Brian Paul 2011-11-15 06:58:54 UTC
Fixed with commit 6dbf2bac5043564f32cdad08e8d6220618a02080
Comment 4 Vinson Lee 2011-11-16 14:54:01 UTC
mesa: f4c03da3276bee39802236c21a0b5a31f05e2541 (master)

Verified fixed.

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.