Bug 104392

Summary: segfault in intel_update_image_buffers on alt+tab
Product: Mesa Reporter: Märt <anon>
Component: Drivers/DRI/i965Assignee: vadym <vadym.shovkoplias>
Status: RESOLVED DUPLICATE QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: evangelos, freedesktop.org
Version: 17.3   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=104376
https://bugs.freedesktop.org/show_bug.cgi?id=104301
https://bugs.freedesktop.org/show_bug.cgi?id=104342
https://bugs.freedesktop.org/show_bug.cgi?id=104443
Whiteboard:
i915 platform: i915 features:
Attachments: gdb log with the crash info

Description Märt 2017-12-27 11:15:33 UTC
When playing SHENZHEN_IO and switching to another window using alt+tab, the game crashes:

Thread 1 (Thread 0x7f69b0d32780 (LWP 27202)):
#0  0x00007f69b01f4890 in __waitpid (pid=pid@entry=27356, stat_loc=stat_loc@entry=0x7f69b0d6301c, options=options@entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00000000004524fc in mono_handle_native_sigsegv (signal=signal@entry=11, ctx=ctx@entry=0x7f69b0d639c0, info=info@entry=0x7f69b0d63af0) at mini-exceptions.c:2427
#2  0x0000000000607832 in mono_arch_handle_altstack_exception (sigctx=sigctx@entry=0x7f69b0d639c0, siginfo=siginfo@entry=0x7f69b0d63af0, fault_addr=<optimized out>, stack_ovf=stack_ovf@entry=0) at exceptions-amd64.c:795
#3  0x0000000000461a17 in mono_sigsegv_signal_handler (_dummy=11, _info=0x7f69b0d63af0, context=0x7f69b0d639c0) at mini-runtime.c:2865
#4  <signal handler called>
#5  0x00007f69a4965513 in intel_update_image_buffers (brw=brw@entry=0x154a6d0, drawable=drawable@entry=0x13c2020) at mesa/drivers/dri/i965/brw_context.c:1698
#6  0x00007f69a496783e in intel_update_renderbuffers (context=context@entry=0x15a4ac0, drawable=drawable@entry=0x13c2020) at mesa/drivers/dri/i965/brw_context.c:1358
#7  0x00007f69a49678f7 in intel_prepare_render (brw=brw@entry=0x154a6d0) at mesa/drivers/dri/i965/brw_context.c:1379
#8  0x00007f69a49632a0 in brw_clear (ctx=0x154a6d0, mask=256) at mesa/drivers/dri/i965/brw_clear.c:278
#9  0x00007f69a4597ce5 in clear (no_error=false, mask=16384, ctx=0x154a6d0) at mesa/main/clear.c:221
#10 _mesa_Clear (mask=<optimized out>) at mesa/main/clear.c:242

Looks like a segfault at mesa/drivers/dri/i965/brw_context.c:1698

1697 if (images.image_mask & __DRI_IMAGE_BUFFER_BACK) {
1698    drawable->w = images.back->width;
1699    drawable->h = images.back->height;
1700    intel_update_image_buffer(brw,
1701                              drawable,
1702                              back_rb,
1703                              images.back,
1704                              __DRI_IMAGE_BUFFER_BACK);
1705 }

mesa 17.3.0
kde plasma 5.11.4
xorg-server 1.19.5 + glamor
kernel 4.14.8
gentoo ~amd64

Extended renderer info (GLX_MESA_query_renderer):
  Vendor: Intel Open Source Technology Center (0x8086)
  Device: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2)  (0x5916)

Reproduces very reliably, but not every time. Just start the game and alt-tab between konsole/firefox/game 2-3 times.
Comment 1 vadym 2018-01-11 08:22:12 UTC
Able to reproduce the same issue on HP Zbook with Ubuntu 16.04:

System Information
        Manufacturer: HP
        Product Name: HP ZBook 14u G4
        Version:  
        Serial Number: 5CG7442WKZ
        UUID: C8764034-3466-44AD-4BD7-92CFB70F9AD0
        Wake-up Type: Power Switch
        SKU Number: 1LL55AV
        Family: 103C_5336AN HP EliteBook

# glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) x86/MMX/SSE2 (0x5916)
    Version: 17.4.0
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) x86/MMX/SSE2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel (git-42f421cbbf)
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 17.4.0-devel (git-42f421cbbf)
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 17.4.0-devel (git-42f421cbbf)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20



Issue is reproducible on 17.4.0-devel mesa and not reproducible on 17.2.4 mesa.
I'll try to bisect it.
Comment 2 vadym 2018-01-11 08:25:01 UTC
Created attachment 136660 [details]
gdb log with the crash info
Comment 3 Evangelos Foutras 2018-01-11 08:33:28 UTC
(In reply to vadym from comment #1)
> Issue is reproducible on 17.4.0-devel mesa and not reproducible on 17.2.4
> mesa.
> I'll try to bisect it.

Likely a duplicate of bug 104214; might want to try the patch from comment 29 on that bug.
Comment 4 vadym 2018-01-11 09:30:07 UTC
(In reply to Evangelos Foutras from comment #3)
> (In reply to vadym from comment #1)
> > Issue is reproducible on 17.4.0-devel mesa and not reproducible on 17.2.4
> > mesa.
> > I'll try to bisect it.
> 
> Likely a duplicate of bug 104214; might want to try the patch from comment
> 29 on that bug.

Issue is no longer reproducible with the patch from comment 29. So bug can be closed.
Comment 5 Evangelos Foutras 2018-01-11 09:39:39 UTC

*** This bug has been marked as a duplicate of bug 104214 ***

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.