Bug 107764 - Crash during texture upload linear_to_ytiled_faster
Summary: Crash during texture upload linear_to_ytiled_faster
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 18.1
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-30 18:59 UTC by Matteo Valdina
Modified: 2018-08-31 14:08 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Valdina 2018-08-30 18:59:30 UTC
I'm facing a crash in the linear_to_ytiled_faster.

The renderer is a gstreamer-waylandsink and the wayland compositor is based on weston 5.0 (the issue is the same with libweston 4.0)
I tried with Mesa 18.0.2 and 18.1.7.

The crash happened at the beginning and it is always reproducible.

Linux localhost 4.12.14-lp150.11-default #1 SMP Fri May 11 08:28:30 UTC 2018 (a9fee09) x86_64 x86_64 x86_64 GNU/Linux

#0  0x00007f298c251518 in linear_to_ytiled_faster (x0=0, x1=0, x2=<optimized out>, x3=<optimized out>, y0=y0@entry=0, y1=y1@entry=32, dst=0x7f298886c000 "",
    src=0x7f2989855000 <error: Cannot access memory at address 0x7f2989855000>, src_pitch=3840, swizzle_bit=0, mem_copy=0x7f2990f0e0b0 <__memcpy_ssse3>)
    at intel_tiled_memcpy.c:569
569     {
[Current thread is 1 (Thread 0x7f2992aad400 (LWP 14471))]
(gdb) bt
#0  0x00007f298c251518 in linear_to_ytiled_faster (x0=0, x1=0, x2=<optimized out>, x3=<optimized out>, y0=y0@entry=0, y1=y1@entry=32, dst=0x7f298886c000 "",
    src=0x7f2989855000 <error: Cannot access memory at address 0x7f2989855000>, src_pitch=3840, swizzle_bit=0, mem_copy=0x7f2990f0e0b0 <__memcpy_ssse3>)
    at intel_tiled_memcpy.c:569
#1  0x00007f298c252962 in linear_to_tiled (xt1=0, xt2=3840, yt1=0, yt2=1080, dst=dst@entry=0x7f298886c000 "",
    src=src@entry=0x7f2989855000 <error: Cannot access memory at address 0x7f2989855000>, dst_pitch=3840, src_pitch=3840, has_swizzling=false,
    tiling=ISL_TILING_Y0, mem_copy=0x7f2990f0e0b0 <__memcpy_ssse3>) at intel_tiled_memcpy.c:759
#2  0x00007f298c24ec28 in intel_texsubimage_tiled_memcpy (dims=2, zoffset=<optimized out>, depth=1, packing=0x2281708, pixels=0x7f2989855000, type=5121,
    format=32993, height=1080, width=960, yoffset=<optimized out>, xoffset=<optimized out>, texImage=0x2358e70, ctx=0x2278180) at intel_tex_image.c:293
#3  intel_upload_tex (ctx=ctx@entry=0x2278180, dims=dims@entry=2, texImage=texImage@entry=0x2358e70, xoffset=xoffset@entry=0, yoffset=yoffset@entry=0,
    zoffset=zoffset@entry=0, width=960, height=1080, depth=1, format=32993, type=5121, pixels=0x7f2989855000, packing=0x2281708) at intel_tex_image.c:342
#4  0x00007f298c24eef1 in intelTexImage (ctx=0x2278180, dims=2, texImage=0x2358e70, format=32993, type=5121, pixels=0x7f2989855000, unpack=0x2281708)
    at intel_tex_image.c:377
#5  0x00007f298bf5ff33 in teximage (no_error=false, pixels=0x7f2989855000, imageSize=0, type=5121, format=32993, border=0, depth=<optimized out>,
    height=<optimized out>, width=<optimized out>, internalFormat=<optimized out>, level=0, target=3553, dims=2, compressed=0 '\000', ctx=0x2278180)
    at main/teximage.c:3101
#6  teximage_err (ctx=0x2278180, compressed=compressed@entry=0 '\000', dims=dims@entry=2, target=3553, level=0, internalFormat=<optimized out>, width=960,
    height=1080, depth=1, border=<optimized out>, format=32993, type=5121, imageSize=0, pixels=0x7f2989855000) at main/teximage.c:3128
#7  0x00007f298bf61970 in _mesa_TexImage2D (target=<optimized out>, level=<optimized out>, internalFormat=<optimized out>, width=<optimized out>,
    height=<optimized out>, border=<optimized out>, format=32993, type=5121, pixels=0x7f2989855000) at main/teximage.c:3166
#8  0x00007f298d2b1115 in gl_renderer_flush_damage (surface=<optimized out>) at libweston/gl-renderer.c:1478
#9  0x00007f2991ec4ca8 in ?? () from /usr/lib64/libweston-5.so.0
#10 0x00007f2991ca2d59 in wl_event_source_timer_dispatch (source=0x21300a0, ep=<optimized out>) at src/event-loop.c:236
#11 0x00007f2991ca3412 in wl_event_loop_dispatch (loop=0x2131180, timeout=timeout@entry=-1) at src/event-loop.c:641
#12 0x00007f2991ca202a in wl_display_run (display=0x212f930) at src/wayland-server.c:1260
#13 0x000000000040535a in Compositor::run (this=0x7fff2eb5f2a0)
    at /home/mvaldina/GITLocal/compositor.cpp:155
#14 0x0000000000403346 in main (argc=1, argv=0x7fff2eb5f488) at /home/mvaldina/GITLocal/main.cpp:114
Comment 1 Matteo Valdina 2018-08-30 20:31:10 UTC
Same stack trace but without optimization

(gdb) bt
#0  __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memcpy-ssse3.S:1819
#1  0x00007fb6e3ca3e14 in linear_to_ytiled (x0=0, x1=0, x2=128, x3=128, y0=0, y3=32, dst=0x7fb6e0174000 "", src=0x7fb6e1293000 <error: Cannot access memory at address 0x7fb6e1293000>, src_pitch=2560, swizzle_bit=0, 
    mem_copy=0x7fb6e8cff0b0 <__memcpy_ssse3>, mem_copy_align16=0x7fb6e8cff0b0 <__memcpy_ssse3>) at intel_tiled_memcpy.c:364
#2  0x00007fb6e3ca4bab in linear_to_ytiled_faster (x0=0, x1=0, x2=128, x3=128, y0=0, y1=32, dst=0x7fb6e0174000 "", src=0x7fb6e1293000 <error: Cannot access memory at address 0x7fb6e1293000>, src_pitch=2560, swizzle_bit=0, 
    mem_copy=0x7fb6e8cff0b0 <__memcpy_ssse3>) at intel_tiled_memcpy.c:632
#3  0x00007fb6e3ca537e in linear_to_tiled (xt1=0, xt2=2560, yt1=0, yt2=720, dst=0x7fb6e0174000 "", src=0x7fb6e1293000 <error: Cannot access memory at address 0x7fb6e1293000>, dst_pitch=2560, src_pitch=2560, has_swizzling=false, 
    tiling=ISL_TILING_Y0, mem_copy=0x7fb6e8cff0b0 <__memcpy_ssse3>) at intel_tiled_memcpy.c:819
#4  0x00007fb6e3ca13ed in intel_texsubimage_tiled_memcpy (ctx=0x13c6ba0, dims=2, texImage=0x19386a0, xoffset=0, yoffset=0, zoffset=0, width=640, height=720, depth=1, format=32993, type=5121, pixels=0x7fb6e1293000, packing=0x13d05a0)
    at intel_tex_image.c:292
#5  0x00007fb6e3ca155a in intel_upload_tex (ctx=0x13c6ba0, dims=2, texImage=0x19386a0, xoffset=0, yoffset=0, zoffset=0, width=640, height=720, depth=1, format=32993, type=5121, pixels=0x7fb6e1293000, packing=0x13d05a0)
    at intel_tex_image.c:338
#6  0x00007fb6e3ca1777 in intelTexImage (ctx=0x13c6ba0, dims=2, texImage=0x19386a0, format=32993, type=5121, pixels=0x7fb6e1293000, unpack=0x13d05a0) at intel_tex_image.c:373
#7  0x00007fb6e38429bd in teximage (no_error=false, pixels=0x7fb6e1293000, imageSize=0, type=5121, format=32993, border=0, depth=1, height=720, width=640, internalFormat=32993, level=0, target=3553, dims=2, compressed=0 '\000', 
    ctx=0x13c6ba0) at main/teximage.c:3102
#8  teximage_err (ctx=0x13c6ba0, compressed=0 '\000', dims=2, target=3553, level=0, internalFormat=32993, width=640, height=720, depth=1, border=0, format=32993, type=5121, imageSize=0, pixels=0x7fb6e1293000) at main/teximage.c:3129
#9  0x00007fb6e384347b in _mesa_TexImage2D (target=3553, level=0, internalFormat=32993, width=640, height=720, border=0, format=32993, type=5121, pixels=0x7fb6e1293000) at main/teximage.c:3167
#10 0x00007fb6e50a2115 in gl_renderer_flush_damage (surface=<optimized out>) at libweston/gl-renderer.c:1478
#11 0x00007fb6e9cb5ca8 in ?? () from /usr/lib64/libweston-5.so.0
#12 0x00007fb6e9a93d59 in wl_event_source_timer_dispatch (source=0x127e0a0, ep=<optimized out>) at src/event-loop.c:236
#13 0x00007fb6e9a94412 in wl_event_loop_dispatch (loop=0x127f180, timeout=timeout@entry=-1) at src/event-loop.c:641
#14 0x00007fb6e9a9302a in wl_display_run (display=0x127d930) at src/wayland-server.c:1260
Comment 2 Matteo Valdina 2018-08-31 14:08:11 UTC
After digging more deeply in this issue I figured out that the issue is in the caller (weston, gl-renderer).

The caller is uploading a texture and passing a wrong pixels buffer. It wrongly computes the offset.

I'll close this issue and report the bug to the weston project.


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.