Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wayland / weston on mesa / grate #9

Open
jochenjagers opened this issue May 18, 2020 · 1 comment
Open

wayland / weston on mesa / grate #9

jochenjagers opened this issue May 18, 2020 · 1 comment

Comments

@jochenjagers
Copy link

Hello,

i try to run weston on a T20 but it won't work.
Is this not supported yet, is it a bug or I'm doing something wrong?

weston log and gdb backtrace:

[12:41:46.922] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: unknown (not built from git or tarball)
[12:41:46.922] Command line: /usr/bin/weston --tty 4
[12:41:46.922] OS: Linux, 4.19.98, #1 SMP PREEMPT Fri May 15 07:25:02 UTC 2020, armv7l
[12:41:46.922] warning: XDG_RUNTIME_DIR "/tmp/runtime-root" is not configured
correctly.  Unix access mode must be 0700 (current mode is 755),
and must be owned by the user (current owner is UID 0).
Refer to your distribution on how to get it, or
http://www.freedesktop.org/wiki/Specifications/basedir-spec
on how to implement it.
[12:41:46.923] Starting with no config file.
[12:41:46.923] Output repaint window is 7 ms maximum.
[12:41:46.924] Loading module '/usr/lib/libweston-3/drm-backend.so'
[12:41:47.041] initializing drm backend
[12:41:47.059] using /dev/dri/card0
[12:41:47.060] Loading module '/usr/lib/libweston-3/gl-renderer.so'
[12:41:53.464] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_device_base EGL_EXT_device_enumeration
               EGL_EXT_device_query EGL_EXT_platform_base
               EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug
               EGL_EXT_platform_wayland EGL_MESA_platform_gbm
               EGL_MESA_platform_surfaceless EGL_EXT_platform_device
[12:41:53.479] warning: neither EGL_EXT_swap_buffers_with_damage or EGL_KHR_swap_buffers_with_damage is supported. Performance could be affected.
[12:41:53.479] EGL_KHR_surfaceless_context available
[12:41:53.485] EGL version: 1.4
[12:41:53.485] EGL vendor: Mesa Project
[12:41:53.485] EGL client APIs: OpenGL OpenGL_ES 
[12:41:53.486] EGL extensions: EGL_ANDROID_blob_cache EGL_EXT_buffer_age
               EGL_EXT_image_dma_buf_import EGL_KHR_cl_event2
               EGL_KHR_config_attribs EGL_KHR_create_context
               EGL_KHR_create_context_no_error EGL_KHR_fence_sync
               EGL_KHR_get_all_proc_addresses EGL_KHR_gl_renderbuffer_image
               EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image
               EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_reusable_sync
               EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float
               EGL_KHR_wait_sync EGL_MESA_configless_context
               EGL_MESA_drm_image EGL_MESA_image_dma_buf_export
               EGL_MESA_query_driver EGL_WL_bind_wayland_display
[12:41:53.486] GL version: OpenGL ES 2.0 Mesa 19.3.1 (git-eb009ef53c)
[12:41:53.486] GLSL version: OpenGL ES GLSL ES 1.0.16
[12:41:53.486] GL vendor: Grate
[12:41:53.486] GL renderer: Tegra
[12:41:53.486] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
               GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1
               GL_EXT_texture_format_BGRA8888
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_element_index_uint GL_OES_fbo_render_mipmap
               GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives
               GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float
               GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_EGL_image
               GL_OES_depth_texture GL_OES_packed_depth_stencil
               GL_AMD_compressed_ATC_texture
               GL_EXT_texture_type_2_10_10_10_REV GL_OES_get_program_binary
               GL_APPLE_texture_max_level GL_EXT_discard_framebuffer
               GL_EXT_read_format_bgra GL_EXT_frag_depth
               GL_NV_fbo_color_attachments GL_OES_EGL_image_external
               GL_OES_EGL_sync GL_OES_vertex_array_object
               GL_ANGLE_texture_compression_dxt3
               GL_ANGLE_texture_compression_dxt5 GL_EXT_unpack_subimage
               GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth
               GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers
               GL_EXT_map_buffer_range GL_KHR_debug
               GL_KHR_texture_compression_astc_ldr
               GL_OES_required_internalformat GL_OES_surfaceless_context
               GL_EXT_separate_shader_objects
               GL_EXT_compressed_ETC1_RGB8_sub_texture
               GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp
               GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex
               GL_OES_texture_border_clamp GL_KHR_no_error
               GL_KHR_texture_compression_astc_sliced_3d
               GL_EXT_texture_compression_s3tc_srgb
               GL_KHR_parallel_shader_compile
[12:41:53.487] GL ES 2 renderer features:
               read-back format: BGRA
               wl_shm sub-image to texture: yes
               EGL Wayland extension: yes
[12:41:53.491] event0  - [12:41:53.491] EP0700M06: [12:41:53.491] is tagged by udev as: Touchscreen
[12:41:53.491] event0  - [12:41:53.491] EP0700M06: [12:41:53.491] device is a touch device
[12:41:53.493] event2  - [12:41:53.493] gpio-keys: [12:41:53.493] is tagged by udev as: Keyboard
[12:41:53.493] event2  - [12:41:53.493] gpio-keys: [12:41:53.493] device is a keyboard
[12:41:53.599] event1  - [12:41:53.599] wm97xx touchscreen: [12:41:53.599] is tagged by udev as: Touchscreen
[12:41:53.599] event1  - [12:41:53.599] wm97xx touchscreen: [12:41:53.599] device is a touch device
[12:41:53.628] Registered plugin API 'weston_drm_output_api_v1' of size 12
[12:41:53.630] Chosen EGL config details:
               RGBA bits: 8 8 8 0
               swap interval range: 1 - 1
[12:41:53.630] Failed to initialize backlight
[12:41:53.631] Output LVDS-1, (connector 41, crtc 40)
               mode [email protected], preferred, current
[12:41:53.632] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
               presentation clock: CLOCK_MONOTONIC, id 1
               presentation clock resolution: 0.000000001 s
[12:41:53.633] Loading module '/usr/lib/weston/desktop-shell.so'
[12:41:53.712] launching '/usr/libexec/weston-keyboard'
[12:41:53.719] launching '/usr/libexec/weston-desktop-shell'
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:217/grate_stream_push_reloc(): drm_tegra_pushbuf_relocate() failed -22
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:209/grate_stream_push_reloc(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:209/grate_stream_push_reloc(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:337/grate_stream_push_words(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:236/grate_stream_push(): Stream status isn't CONSTRUCT
../../../../../../workspace/sources/mesa/src/gallium/drivers/grate/grate_stream.c:288/grate_stream_end(): Stream status isn't CONSTRUCT
could not load cursor 'dnd-move'
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
xkbcommon: ERROR: Couldn't read Compose file /tmp/compose: Invalid argument
could not create XKB compose table for locale 'C'.  Disabiling compose
xkbcommon: ERROR: Couldn't read Compose file /tmp/compose: Invalid argument
could not create XKB compose table for locale 'C'.  Disabiling compose

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xb642b114 in st_create_texture_sampler_view_from_stobj (glsl130_or_later=false, format=<optimized out>, stObj=0x3a64a0, st=0x82ee0)
    at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_sampler_view.c:551
#2  st_get_texture_sampler_view_from_stobj (st=st@entry=0x82ee0, stObj=stObj@entry=0x3a64a0, samp=samp@entry=0x3a64b4, glsl130_or_later=glsl130_or_later@entry=false, 
    ignore_srgb_decode=ignore_srgb_decode@entry=false) at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_sampler_view.c:595
#3  0xb65180d8 in st_update_single_texture (st=st@entry=0x82ee0, sampler_view=sampler_view@entry=0xbefff158, texUnit=<optimized out>, glsl130_or_later=glsl130_or_later@entry=false, 
    ignore_srgb_decode=ignore_srgb_decode@entry=false) at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_atom_texture.c:93
#4  0xb6518294 in update_textures (st=0x82ee0, shader_stage=PIPE_SHADER_FRAGMENT, prog=0x3b4ff0, sampler_views=0x833b4)
    at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_atom_texture.c:156
#5  0xb65d9804 in st_validate_state (st=st@entry=0x82ee0, pipeline=pipeline@entry=ST_PIPELINE_RENDER) at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_atom.c:261
#6  0xb6523dd8 in prepare_draw (ctx=0x6a7c8, st=0x82ee0) at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_draw.c:132
#7  st_draw_vbo (ctx=ctx@entry=0x6a7c8, prims=<optimized out>, nr_prims=nr_prims@entry=1, ib=0x0, index_bounds_valid=index_bounds_valid@entry=1 '\001', min_index=<optimized out>, min_index@entry=0, 
    max_index=<optimized out>, max_index@entry=3, tfb_vertcount=0x0, stream=0, indirect=0x0) at ../../../../../../workspace/sources/mesa/src/mesa/state_tracker/st_draw.c:184
#8  0xb65c7ea8 in _mesa_draw_arrays (ctx=0x6a7c8, mode=<optimized out>, start=0, count=4, numInstances=1, baseInstance=0, drawID=0) at ../../../../../../workspace/sources/mesa/src/mesa/main/draw.c:374
#9  0xb65c7f5c in _mesa_DrawArrays (mode=6, start=0, count=4) at ../../../../../../workspace/sources/mesa/src/mesa/main/draw.c:531
#10 0xb6b18068 in repaint_region (ev=ev@entry=0x3ab2a8, region=region@entry=0xbefff41c, surf_region=surf_region@entry=0xbefff430) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/gl-renderer.c:661
#11 0xb6b1856c in draw_view (damage=<optimized out>, output=<optimized out>, ev=0xac738) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/gl-renderer.c:826
#12 repaint_views (output=0xbf800000, output@entry=0xac780, damage=0x1e0, damage@entry=0xbefff4b8) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/gl-renderer.c:850
#13 0xb6b18804 in gl_renderer_repaint_output (output=0xac780, output_damage=0x0) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/gl-renderer.c:1145
#14 0xb6baab78 in drm_output_render_gl (damage=0xbefff65c, output=0xac780) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor-drm.c:734
#15 drm_output_render (damage=0xbefff65c, output=0xac780) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor-drm.c:796
#16 drm_output_repaint (output_base=0xac780, damage=0xbefff65c, repaint_data=<optimized out>) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor-drm.c:880
#17 0xb6fa98f0 in weston_output_repaint (repaint_data=<optimized out>, output=<optimized out>) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor.c:2312
#18 weston_output_maybe_repaint (repaint_data=<optimized out>, now=0xb6fcd000, output=<optimized out>) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor.c:2376
#19 output_repaint_timer_handler (data=0x0) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/libweston/compositor.c:2442
#20 0xb6f836f8 in wl_event_source_timer_dispatch (source=0x2e8d8, ep=<optimized out>) at /usr/src/debug/wayland/1.16.0-r0/wayland-1.16.0/src/event-loop.c:236
#21 0xb6f83c80 in wl_event_loop_dispatch (loop=0x2d5a0, timeout=timeout@entry=-1) at /usr/src/debug/wayland/1.16.0-r0/wayland-1.16.0/src/event-loop.c:641
#22 0xb6f82a00 in wl_display_run (display=0x2d530, display@entry=0xb6ff72c8) at /usr/src/debug/wayland/1.16.0-r0/wayland-1.16.0/src/wayland-server.c:1260
#23 0x000143e0 in main (argc=<optimized out>, argv=0xbefffd44) at /usr/src/debug/weston/3.0.0-r0/weston-3.0.0/compositor/main.c:1969
@digetx
Copy link
Member

digetx commented May 18, 2020

Yes, it's not supported yet.

digetx pushed a commit that referenced this issue Oct 26, 2020
This patch fixes memory leaks when reply is allocated and is not freed
on error execution path.

Found by enabling address sanitizer on simple EGL app.

```c

int main()
{
    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    EGLint major;
    EGLint minor;

    if (!eglInitialize(display, &major, &minor))
    {
        return 1;
    }
    eglTerminate(display);
    return 0;
}
```

Compiled with: `gcc testme.c -o testme -fsanitize=address -lasan -lEGL`

Execution environment:
- Windows 10, VMWare Player 15.5.2 build-15785246 without 3D accelaration
- Guest OS: OpenSUSE Leap 15.2
- Mesa 19.3.4

Program output:

```sh
ASAN_OPTIONS=fast_unwind_on_malloc=0 ./testme

libEGL warning: DRI2: failed to authenticate
==52510==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7fa62315f500 in malloc (/usr/lib64/libasan.so.4+0xdc500)
    #1 0x7fa61e12d86b  (/usr/lib64/libxcb.so.1+0xf86b)
    #2 0x7fa61e12b5c7  (/usr/lib64/libxcb.so.1+0xd5c7)
    #3 0x7fa61e12cc3e  (/usr/lib64/libxcb.so.1+0xec3e)
    #4 0x7fa61e12cd4f in xcb_wait_for_reply (/usr/lib64/libxcb.so.1+0xed4f)
    #5 0x7fa61ebe02a5  (/usr/lib64/libEGL_mesa.so.0+0x202a5)
    #6 0x7fa61ebdb5ca  (/usr/lib64/libEGL_mesa.so.0+0x1b5ca)
    #7 0x7fa61ebd750c  (/usr/lib64/libEGL_mesa.so.0+0x1750c)
    #8 0x7fa61ebd7554  (/usr/lib64/libEGL_mesa.so.0+0x17554)
    #9 0x7fa61ebd1107  (/usr/lib64/libEGL_mesa.so.0+0x11107)
    #10 0x400856 in main (/home/user/testme+0x400856)
    #11 0x7fa622ad8349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #12 0x4006e9 in _start (/home/user/testme+0x4006e9)

SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).
```

Signed-off-by: Andrey Vostrikov <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6611>
(cherry picked from commit 4242073)
digetx pushed a commit that referenced this issue May 15, 2022
need to iterate over the descriptors in the binding to invalidate the whole
thing here

=================================================================
==546534==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a0000ae6c0 at pc 0x7fe20e26fd9d bp 0x7ffd92be6bc0 sp 0x7ffd92be6bb8
READ of size 8 at 0x61a0000ae6c0 thread T0
    #0 0x7fe20e26fd9c in zink_descriptor_set_refs_clear ../src/gallium/drivers/zink/zink_descriptors.c:950
    #1 0x7fe20e401304 in zink_destroy_surface ../src/gallium/drivers/zink/zink_surface.c:340
    #2 0x7fe20e21311b in zink_surface_reference ../src/gallium/drivers/zink/zink_surface.h:106
    #3 0x7fe20e21a5b9 in zink_sampler_view_destroy ../src/gallium/drivers/zink/zink_context.c:835
    #4 0x7fe20c41d35f in tc_sampler_view_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:1848
    #5 0x7fe20e210ff7 in pipe_sampler_view_reference ../src/gallium/auxiliary/util/u_inlines.h:216
    #6 0x7fe20e22d592 in zink_set_sampler_views ../src/gallium/drivers/zink/zink_context.c:1532
    #7 0x7fe20c41a3d8 in tc_call_set_sampler_views ../src/gallium/auxiliary/util/u_threaded_context.c:1393
    #8 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #9 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #10 0x7fe20c42b728 in tc_destroy ../src/gallium/auxiliary/util/u_threaded_context.c:4250
    #11 0x7fe20b65176a in st_destroy_context_priv ../src/mesa/state_tracker/st_context.c:387
    #12 0x7fe20b65669f in st_destroy_context ../src/mesa/state_tracker/st_context.c:1009
    #13 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #14 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #15 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #16 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #17 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #18 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #19 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384
    #20 0x41b88a in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:734
    #21 0x41b8e9 in tcu::lnx::x11::glx::GlxRenderContext::~GlxRenderContext() /home/zmike/src/VK-GL-CTS/framework/platform/lnx/X11/tcuLnxX11GlxPlatform.cpp:735
    #22 0x2323aa7 in deqp::gles31::Context::destroyRenderContext() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:77
    #23 0x2323969 in deqp::gles31::Context::~Context() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31Context.cpp:55
    #24 0x232278e in deqp::gles31::TestPackage::deinit() /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestPackage.cpp:102
    #25 0x2c866c2 in tcu::DefaultHierarchyInflater::leaveTestPackage(tcu::TestPackage*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:75
    #26 0x2c87058 in tcu::TestHierarchyIterator::next() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestHierarchyIterator.cpp:252
    #27 0x2c365da in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:122
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7fe2263e160b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x61a0000ae6c0 is located 64 bytes inside of 1328-byte region [0x61a0000ae680,0x61a0000aebb0)
freed by thread T0 here:
    #0 0x7fe226cb6627 in free (/usr/lib64/libasan.so.6+0xae627)
    #1 0x7fe20aab1751 in unsafe_free ../src/util/ralloc.c:302
    #2 0x7fe20aab16c8 in unsafe_free ../src/util/ralloc.c:295
    #3 0x7fe20aab13c3 in ralloc_free ../src/util/ralloc.c:265
    #4 0x7fe20e269234 in descriptor_pool_free ../src/gallium/drivers/zink/zink_descriptors.c:286
    #5 0x7fe20e26937d in descriptor_pool_delete ../src/gallium/drivers/zink/zink_descriptors.c:296
    #6 0x7fe20e26ff53 in zink_descriptor_pool_reference ../src/gallium/drivers/zink/zink_descriptors.c:967
    #7 0x7fe20e270db2 in zink_descriptor_program_deinit ../src/gallium/drivers/zink/zink_descriptors.c:1071
    #8 0x7fe20e3b6536 in zink_destroy_gfx_program ../src/gallium/drivers/zink/zink_program.c:695
    #9 0x7fe20e1eaaf9 in zink_gfx_program_reference ../src/gallium/drivers/zink/zink_program.h:242
    #10 0x7fe20e20d386 in zink_shader_free ../src/gallium/drivers/zink/zink_compiler.c:2099
    #11 0x7fe20e3b9f0b in zink_delete_shader_state ../src/gallium/drivers/zink/zink_program.c:1074
    #12 0x7fe20c3e29ad in util_shader_reference ../src/gallium/auxiliary/util/u_live_shader_cache.c:188
    #13 0x7fe20e3ba11e in zink_delete_cached_shader_state ../src/gallium/drivers/zink/zink_program.c:1093
    #14 0x7fe20c41709e in tc_call_delete_fs_state ../src/gallium/auxiliary/util/u_threaded_context.c:998
    #15 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fe20c423683 in tc_flush ../src/gallium/auxiliary/util/u_threaded_context.c:3003
    #18 0x7fe20b62d996 in st_flush ../src/mesa/state_tracker/st_cb_flush.c:60
    #19 0x7fe20b62dbe3 in st_glFlush ../src/mesa/state_tracker/st_cb_flush.c:94
    #20 0x7fe20ae4bded in _mesa_make_current ../src/mesa/main/context.c:1493
    #21 0x7fe20ae49702 in _mesa_free_context_data ../src/mesa/main/context.c:1187
    #22 0x7fe20b65668b in st_destroy_context ../src/mesa/state_tracker/st_context.c:1005
    #23 0x7fe20b7055ab in st_context_destroy ../src/mesa/state_tracker/st_manager.c:944
    #24 0x7fe20a9c75bd in dri_destroy_context ../src/gallium/frontends/dri/dri_context.c:256
    #25 0x7fe20a9d4bef in driDestroyContext ../src/gallium/frontends/dri/dri_util.c:534
    #26 0x7fe22361f25c in drisw_destroy_context ../src/glx/drisw_glx.c:429
    #27 0x7fe223625d95 in glXDestroyContext ../src/glx/glxcmds.c:523
    #28 0x7fe22636aaeb in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GLX/libglx.c:332
    #29 0x7fe2269d9e7d in glXDestroyContext /home/zmike/src/libglvnd-v1.3.2/src/GL/g_libglglxwrapper.c:384

previously allocated by thread T0 here:
    #0 0x7fe226cb691f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fe20aab0c81 in ralloc_size ../src/util/ralloc.c:120
    #2 0x7fe20aab0e33 in rzalloc_size ../src/util/ralloc.c:153
    #3 0x7fe20aab12c8 in rzalloc_array_size ../src/util/ralloc.c:233
    #4 0x7fe20e26c76d in allocate_desc_set ../src/gallium/drivers/zink/zink_descriptors.c:657
    #5 0x7fe20e26e9cb in zink_descriptor_set_get ../src/gallium/drivers/zink/zink_descriptors.c:840
    #6 0x7fe20e2747aa in zink_descriptors_update ../src/gallium/drivers/zink/zink_descriptors.c:1424
    #7 0x7fe20e36fc48 in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:788
    #8 0x7fe20e29166d in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #9 0x7fe20c424982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #10 0x7fe20c411706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #11 0x7fe20c4124ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #12 0x7fe20c41f7a9 in tc_texture_map ../src/gallium/auxiliary/util/u_threaded_context.c:2279
    #13 0x7fe20b630757 in pipe_texture_map_3d ../src/gallium/auxiliary/util/u_inlines.h:572
    #14 0x7fe20b6341f6 in st_ReadPixels ../src/mesa/state_tracker/st_cb_readpixels.c:546
    #15 0x7fe20b42fea7 in read_pixels ../src/mesa/main/readpix.c:1178
    #16 0x7fe20b42fea7 in _mesa_ReadnPixelsARB ../src/mesa/main/readpix.c:1195
    #17 0x7fe20b42ffc0 in _mesa_ReadPixels ../src/mesa/main/readpix.c:1210
    #18 0x2a6d094 in glu::readPixels(glu::RenderContext const&, int, int, tcu::PixelBufferAccess const&) /home/zmike/src/VK-GL-CTS/framework/opengl/gluPixelTransfer.cpp:61
    #19 0x29eaa06 in deqp::gls::ShaderExecUtil::FragmentOutExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:677
    #20 0x25a600b in iterate /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fOpaqueTypeIndexingTests.cpp:585
    #21 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #22 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #23 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #24 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #25 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #26 0x7fe2263e155f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
(cherry picked from commit 698ae34)
digetx pushed a commit that referenced this issue May 15, 2022
Test case 'dEQP-GLES31.functional.shaders.builtin_functions.common.modf.vec2_mediump_tess_control'..
=================================================================
==539161==ERROR: AddressSanitizer: unknown-crash on address 0x60400008cfef at pc 0x7fffdb47b2d6 bp 0x7fffffffa490 sp 0x7fffffffa488
READ of size 4 at 0x60400008cfef thread T0
    #0 0x7fffdb47b2d5 in XXH_read32 ../src/util/xxhash.h:531
    #1 0x7fffdb47bfbf in XXH_readLE32 ../src/util/xxhash.h:608
    #2 0x7fffdb47bfbf in XXH_readLE32_align ../src/util/xxhash.h:620
    #3 0x7fffdb47bfbf in XXH32_endian_align ../src/util/xxhash.h:797
    #4 0x7fffdb47bfbf in XXH32 ../src/util/xxhash.h:831
    #5 0x7fffdb480b49 in _mesa_hash_data ../src/util/hash_table.c:631
    #6 0x7fffded8c10a in shader_module_hash ../src/gallium/drivers/zink/zink_program.c:82
    #7 0x7fffded8cad8 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:144
    #8 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #9 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #10 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #11 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #12 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #13 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #14 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #15 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #16 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #17 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #18 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #19 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #20 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #21 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #22 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #23 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #24 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #25 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #26 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #27 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #28 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #29 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #30 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)
    #31 0x7ffff6dbc60b in __libc_start_main_impl (/lib64/libc.so.6+0x2d60b)
    #32 0x413fa4 in _start (/home/zmike/src/VK-GL-CTS/build/external/openglcts/modules/glcts+0x413fa4)

0x60400008cff1 is located 0 bytes to the right of 33-byte region [0x60400008cfd0,0x60400008cff1)
allocated by thread T0 here:
    #0 0x7ffff769191f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xae91f)
    #1 0x7fffded8c608 in get_shader_module_for_stage ../src/gallium/drivers/zink/zink_program.c:115
    #2 0x7fffded8cf64 in update_gfx_shader_modules ../src/gallium/drivers/zink/zink_program.c:182
    #3 0x7fffded8dcc2 in zink_update_gfx_program ../src/gallium/drivers/zink/zink_program.c:257
    #4 0x7fffdec63463 in update_gfx_program ../src/gallium/drivers/zink/zink_draw.cpp:223
    #5 0x7fffded7aab9 in update_gfx_pipeline<true> ../src/gallium/drivers/zink/zink_draw.cpp:445
    #6 0x7fffded4a88b in void zink_draw<(zink_multidraw)1, (zink_dynamic_state)2, true, false>(pipe_context*, pipe_draw_info const*, unsigned int, pipe_draw_indirect_info const*, pipe_draw_start_count_bias const*, unsigned int, pipe_vertex_state*, unsigned int) ../src/gallium/drivers/zink/zink_draw.cpp:777
    #7 0x7fffdec6c5b2 in zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)2, true> ../src/gallium/drivers/zink/zink_draw.cpp:907
    #8 0x7fffdcdff982 in tc_call_draw_single ../src/gallium/auxiliary/util/u_threaded_context.c:3155
    #9 0x7fffdcdec706 in tc_batch_execute ../src/gallium/auxiliary/util/u_threaded_context.c:211
    #10 0x7fffdcded4ba in _tc_sync ../src/gallium/auxiliary/util/u_threaded_context.c:362
    #11 0x7fffdcdfa492 in tc_buffer_map ../src/gallium/auxiliary/util/u_threaded_context.c:2251
    #12 0x7fffdb7f2439 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:393
    #13 0x7fffdb7f56c2 in _mesa_bufferobj_map_range ../src/mesa/main/bufferobj.c:488
    #14 0x7fffdb803300 in map_buffer_range ../src/mesa/main/bufferobj.c:3734
    #15 0x7fffdb8036e7 in _mesa_MapBufferRange ../src/mesa/main/bufferobj.c:3817
    #16 0x29ecb02 in deqp::gls::ShaderExecUtil::BufferIoExecutor::readOutputBuffer(void* const*, int) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1069
    #17 0x29ee499 in deqp::gls::ShaderExecUtil::TessControlExecutor::execute(int, void const* const*, void* const*) /home/zmike/src/VK-GL-CTS/modules/glshared/glsShaderExecUtil.cpp:1390
    #18 0x246264c in deqp::gles31::Functional::CommonFunctionCase::iterate() /home/zmike/src/VK-GL-CTS/modules/gles31/functional/es31fShaderCommonFunctionTests.cpp:400
    #19 0x2322b53 in deqp::gles31::TestCaseWrapper<deqp::gles31::TestPackage>::iterate(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/modules/gles31/tes31TestCaseWrapper.hpp:86
    #20 0x2c376fd in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:302
    #21 0x2c366e3 in tcu::TestSessionExecutor::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuTestSessionExecutor.cpp:139
    #22 0x2c00b0c in tcu::App::iterate() /home/zmike/src/VK-GL-CTS/framework/common/tcuApp.cpp:221
    #23 0x4141b7 in main /home/zmike/src/VK-GL-CTS/framework/platform/tcuMain.cpp:58
    #24 0x7ffff6dbc55f in __libc_start_call_main (/lib64/libc.so.6+0x2d55f)

cc: mesa-stable

Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15173>
(cherry picked from commit 62b8daa)

Conflicts:
	src/gallium/drivers/zink/zink_program.c
digetx pushed a commit that referenced this issue Dec 17, 2022
This avoids u_blitter recursion:

 #0  util_blitter_set_running_flag
 #1  util_blitter_custom_color
 #2  si_blit_decompress_color
 #3  si_decompress_dcc
 #4  si_texture_disable_dcc
 #5  si_update_ps_colorbuf0_slot
 #6  si_bind_ps_shader
 #7  util_blitter_restore_fragment_states
 #8  util_blitter_custom_color
 #9  si_blit_decompress_color
 #10 si_decompress_dcc
 #11 si_sdma_copy_image
 #12 si_blit

cc: mesa-stable

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16962>
(cherry picked from commit 3d37291)

Conflicts:
	src/gallium/drivers/radeonsi/si_blit.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants