[Mesa-dev] [Bug 33797] New: memcpy segfault in st_cb_texture.c:171

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Feb 1 00:42:53 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33797

           Summary: memcpy segfault in st_cb_texture.c:171
           Product: Mesa
           Version: git
          Platform: x86 (IA32)
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: nobled at dreamwidth.org


Mesa git: 2f7c876ff5af86c78c0f3debfbdc2a56c7b4d1fe

This happens when using EGL_DRIVER=egl_gallium with pipe_swrast and creating a
texture from a bitmap file that's mmap()'d read-only, like this:

buffer->data = mmap(NULL, buffer->size, PROT_READ, MAP_SHARED, fd, 0);

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x037529f4 in __memcpy (to=0xb61ca044, from=0xb6c8e400, n=4096)
    at state_tracker/st_cb_texture.c:171
171       __asm__ __volatile__("rep ; movsl\n\t"
(gdb) bt
#0  0x037529f4 in __memcpy (to=0xb61ca044, from=0xb6c8e400, n=4096)
    at state_tracker/st_cb_texture.c:171
#1  0x03752a5b in do_memcpy (dest=0xb61ca044, src=0xb6c8e400, n=4096)
    at state_tracker/st_cb_texture.c:204
#2  0x036387ea in memcpy_texture (ctx=0x9d41ce0, dimensions=2, 
    dstFormat=MESA_FORMAT_ARGB8888, dstAddr=0xb5bd0044, dstXoffset=0, 
    dstYoffset=0, dstZoffset=0, dstRowStride=8192, dstImageOffsets=0x9d066a0, 
    srcWidth=1024, srcHeight=768, srcDepth=1, srcFormat=32993, srcType=5121, 
    srcAddr=0xb6bcf000, srcPacking=0x9d50ae4) at main/texstore.c:991
#3  0x03639996 in _mesa_texstore_argb8888 (ctx=0x9d41ce0, dims=2, 
    baseInternalFormat=6408, dstFormat=MESA_FORMAT_ARGB8888, 
    dstAddr=0xb5bd0044, dstXoffset=0, dstYoffset=0, dstZoffset=0, 
    dstRowStride=8192, dstImageOffsets=0x9d066a0, srcWidth=1024, 
    srcHeight=768, srcDepth=1, srcFormat=32993, srcType=5121, 
    srcAddr=0xb6bcf000, srcPacking=0x9d50ae4) at main/texstore.c:1427
#4  0x0363fd9e in _mesa_texstore (ctx=0x9d41ce0, dims=2, 
    baseInternalFormat=6408, dstFormat=MESA_FORMAT_ARGB8888, 
    dstAddr=0xb5bd0044, dstXoffset=0, dstYoffset=0, dstZoffset=0, 
    dstRowStride=8192, dstImageOffsets=0x9d066a0, srcWidth=1024, 
    srcHeight=768, srcDepth=1, srcFormat=32993, srcType=5121, 
    srcAddr=0xb6bcf000, srcPacking=0x9d50ae4) at main/texstore.c:4188
#5  0x03754c26 in st_TexSubimage (ctx=0x9d41ce0, dims=2, target=3553, level=0, 
    xoffset=1, yoffset=1, zoffset=0, width=1024, height=768, depth=1, 
    format=32993, type=5121, pixels=0xb6bcf000, packing=0x9d50ae4, 
    texObj=0x9e8ed70, texImage=0x9d33d20) at state_tracker/st_cb_texture.c:1144
#6  0x03754e25 in st_TexSubImage2D (ctx=0x9d41ce0, target=3553, level=0, 
    xoffset=1, yoffset=1, width=1024, height=768, format=32993, type=5121, 
    pixels=0xb6bcf000, packing=0x9d50ae4, texObj=0x9e8ed70, texImage=0x9d33d20)
    at state_tracker/st_cb_texture.c:1203
#7  0x03631067 in texsubimage (ctx=0x9d41ce0, dims=2, target=3553, level=0, 
    xoffset=1, yoffset=1, zoffset=0, width=1024, height=768, depth=1, 
    format=32993, type=5121, pixels=0xb6bcf000) at main/teximage.c:2655
#8  0x0363128f in _mesa_TexSubImage2D (target=3553, level=0, xoffset=1, 
    yoffset=1, width=1024, height=768, format=32993, type=5121, 
    pixels=0xb6bcf000) at main/teximage.c:2702
#9  0x008594c9 in _cogl_texture_driver_upload_subregion_to_gl (gl_target=3553, 
    gl_handle=5, is_foreign=0, src_x=0, src_y=0, dst_x=1, dst_y=1, width=1024, 
    height=768, source_bmp=0x9d8b800, source_gl_format=32993, 
    source_gl_type=5121)
    at
../../../../../src/clutter-1.5.14/clutter/cogl/cogl/driver/gl/cogl-texture-driver-gl.c:170
#10 0x0088d9ce in _cogl_texture_2d_set_region (tex=0x9e57790, src_x=0, 
    src_y=0, dst_x=1, dst_y=1, dst_width=1024, dst_height=768, bmp=0x9d8b800)
    at
../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-texture-2d.c:611
#11 0x0088ce14 in _cogl_texture_set_region_from_bitmap (handle=0x9e57790, 
    src_x=0, src_y=0, dst_x=1, dst_y=1, dst_width=1024, dst_height=768, 
    bmp=<value optimized out>)
    at ../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-texture.c:860
#12 0x008948d3 in _cogl_atlas_texture_set_region_with_border (
    atlas_tex=0x9ebb600, src_x=-1239637948, src_y=0, dst_x=0, dst_y=0, 
    dst_width=1024, dst_height=768, bmp=0x9d8b800)
    at
../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-atlas-texture.c:367
#13 0x00895013 in _cogl_atlas_texture_new_from_bitmap (bmp=0x9d8b788, 
    flags=COGL_TEXTURE_NONE, internal_format=COGL_PIXEL_FORMAT_BGRA_8888_PRE)
    at
../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-atlas-texture.c:643
#14 0x0088c2f3 in cogl_texture_new_from_bitmap (bmp_handle=0x9d8b788, 
    flags=COGL_TEXTURE_NONE, internal_format=COGL_PIXEL_FORMAT_ANY)
    at ../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-texture.c:446
#15 0x0088c5db in cogl_texture_new_from_data (width=1024, height=768, 
    flags=COGL_TEXTURE_NONE, format=COGL_PIXEL_FORMAT_BGRA_8888_PRE, 
    internal_format=COGL_PIXEL_FORMAT_ANY, rowstride=1024, data=0xb6bcf000 "")
    at ../../../../../src/clutter-1.5.14/clutter/cogl/cogl/cogl-texture.c:431

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list