Bug 27144

Summary: piglit glean/depthStencil test core dumps with RV790
Product: Mesa Reporter: Chris Rankin <rankincj>
Component: Drivers/DRI/R600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Chris Rankin 2010-03-17 15:36:44 UTC
Program terminated with signal 11, Segmentation fault.
#0  0x00007f1d9af0cfdb in radeonWriteDepthSpan_s8_z24 (
    ctx=<value optimized out>, rb=0x30588d0, n=<value optimized out>, 
    x=<value optimized out>, y=971, values=<value optimized out>, mask=0x0)
    at ../../../../../src/mesa/drivers/dri/common/depthtmp.h:61
61			     WRITE_DEPTH( x1, y, depth[i] );
Missing separate debuginfos, use: debuginfo-install expat-2.0.1-8.fc12.x86_64 glibc-2.11.1-1.x86_64 libICE-1.0.6-1.fc12.x86_64 libSM-1.1.0-7.fc12.x86_64 libX11-1.3-1.fc12.x86_64 libXau-1.0.5-1.fc12.x86_64 libXdamage-1.1.2-1.fc12.x86_64 libXext-1.1-2.fc12.x86_64 libXfixes-4.0.4-1.fc12.x86_64 libXi-1.3-2.fc12.x86_64 libXmu-1.0.5-1.fc12.x86_64 libXt-1.0.7-1.fc12.x86_64 libXxf86vm-1.1.0-1.fc12.x86_64 libdrm-2.4.18-0.1.fc12.x86_64 libgcc-4.4.3-4.fc12.x86_64 libjpeg-6b-46.fc12.x86_64 libstdc++-4.4.3-4.fc12.x86_64 libtiff-3.9.2-3.fc12.x86_64 libuuid-2.16.2-7.fc12.x86_64 libxcb-1.5-1.fc12.x86_64 zlib-1.2.3-23.fc12.x86_64
(gdb) where
#0  0x00007f1d9af0cfdb in radeonWriteDepthSpan_s8_z24 (
    ctx=<value optimized out>, rb=0x30588d0, n=<value optimized out>, 
    x=<value optimized out>, y=971, values=<value optimized out>, mask=0x0)
    at ../../../../../src/mesa/drivers/dri/common/depthtmp.h:61
#1  0x00007f1d9afe56f8 in draw_depth_stencil_pixels (ctx=0x2b51c00, x=0, y=0, 
    width=1000, height=972, type=34042, unpack=0x2b618e8, pixels=0x3332b70)
    at swrast/s_drawpix.c:667
#2  0x00007f1d9afe59a4 in _swrast_DrawPixels (ctx=0x2b51c00, 
    x=<value optimized out>, y=<value optimized out>, width=1000, height=1000, 
    format=34041, type=34042, unpack=0x2b618e8, pixels=<value optimized out>)
    at swrast/s_drawpix.c:812
#3  0x00007f1d9b01bb29 in _mesa_meta_DrawPixels (ctx=0x2b51c00, 
    x=<value optimized out>, y=<value optimized out>, 
    width=<value optimized out>, height=<value optimized out>, 
    format=<value optimized out>, type=34042, unpack=0x2b618e8, 
    pixels=0x3332b70) at drivers/common/meta.c:1798
#4  0x00007f1d9b043c05 in _mesa_DrawPixels (width=1000, height=1000, 
    format=34041, type=34042, pixels=0x3332b70) at main/drawpix.c:119
#5  0x00000000004b4583 in GLEAN::DepthStencilTest::readPixelsRate (
    this=0x79dd00, format=34041, type=34042)
    at /home/chris/Programs/piglit/tests/glean/tdepthstencil.cpp:245
#6  0x00000000004b470e in GLEAN::DepthStencilTest::testPerformance (
    this=0x79dd00, r=...)
    at /home/chris/Programs/piglit/tests/glean/tdepthstencil.cpp:274
#7  0x00000000004b484c in GLEAN::DepthStencilTest::runOne (this=0x79dd00, 
    r=..., w=...)
    at /home/chris/Programs/piglit/tests/glean/tdepthstencil.cpp:307
#8  0x00000000004b5e52 in GLEAN::BaseTest<GLEAN::DepthStencilResult>::run (
    this=0x79dd00, environment=...)
    at /home/chris/Programs/piglit/tests/glean/tbase.h:320
#9  0x00000000004906ec in main (argc=5, argv=0x7fff4f4c68d8)
    at /home/chris/Programs/piglit/tests/glean/main.cpp:141
Comment 1 Chris Rankin 2010-03-18 16:51:10 UTC
I don't understand the "why" on this one, just that the SIGSEGV happens within the following WRITE_DEPTH macro:

#define WRITE_DEPTH( _x, _y, d )                                        \
do {                                                                    \
   GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off );               \
   GLuint tmp = *_ptr;                          \
   tmp &= 0xff000000;                                                   \
   tmp |= ((d) & 0x00ffffff);                                   \
   *_ptr = tmp;                                 \
   _ptr = (GLuint*)r600_ptr_stencil(rrb, _x + x_off, _y + y_off);               \
   tmp = *_ptr;                         \
   tmp &= 0xffffff00;                                                   \
   tmp |= ((d) >> 24) & 0xff;                                           \
   *_ptr = tmp;                                 \
} while (0)

The exact location seems to be the second line, where the contents of _ptr are assigned to GLuint tmp. In my particular example, _x = 640, _y = 971 and d = 0 when it explodes.

It might be worth noting that this is an x86_64 machine, although it's definitely SIGSEGV and not SIGBUS.
Comment 2 Andreas Boll 2012-09-13 09:49:59 UTC
Note: classic r600 driver has been abandoned.

the glean/depthStencil test passes with r600g (gallium driver) on my rv770
tested with mesa git master 28f4be9eb91b12a2c6b1db6660cca71a98c486ec

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.