Bug 110697

Summary: glXWaitForMscOML and glXWaitVideoSyncSGI may block indefinitely
Product: Mesa Reporter: acc12345acc
Component: GLXAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: major    
Priority: medium CC: acc12345acc, asdfghrbljzmkd
Version: 19.0Keywords: regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
URL: https://github.com/tildearrow/kwin-lowlatency/tree/0d38a4992c8dead4f96741033077ede50071b43e
Whiteboard:
i915 platform: i915 features:

Description acc12345acc 2019-05-16 20:05:26 UTC
Under certain circumstances, using any of the aforementioned functions under an Intel card may result in the application being blocked until killed.

The application in question is kwin-lowlatency (https://github.com/tildearrow/kwin-lowlatency) which relies upon either function for achieving its goal.

Related issue: https://github.com/tildearrow/kwin-lowlatency/issues/10
Comment 1 Paul 2019-05-17 08:44:51 UTC
Hi Acc,
Thanks for the report.
Could you please provide information to reproduce the problem about: 1) your hardware (GPU, CPU), 2) what distro and Kernel do you use, 3) version of libs, 4) mesa setup configuration?
Also, would be very helpful, if you provide a test or example which will trigger the issue.
Comment 2 acc12345acc 2019-05-18 02:29:22 UTC
Sure.

- CPU: Intel Core i5-3210M
- GPU: Intel HD Graphics 4000
- Distribution: Arch Linux
- Kernel version: 5.0.7-arch1-1-ARCH
- Mesa version: 19.0.4
- X.Org version: 1.20.4
- Using modesetting driver
- /etc/X11/xorg.conf.d/20-i.conf:
```
Section "Screen"
  Identifier "default"
  DefaultDepth 24
EndSection
```

The test case has been mentioned already. However I forgot to include reproduction steps:
1. Compile kwin-lowlatency (mkdir build && cd build && cmake .. && make)
2. Launch it with `QT_PLUGIN_PATH="$PWD/bin" ./bin/kwin_x11 --replace`
3. Move a window to the top left corner as quick as possible and then shake it horizontally
4. Keep trying until it freezes (it usually does on the first or second try)
Comment 3 acc12345acc 2019-05-18 04:54:27 UTC
EDIT: I just tested on my AMD GPU under Mesa 19.0 and it freezes as well... (and has even higher chance of freezing)
Comment 4 QwertyChouskie 2019-05-21 17:13:43 UTC
Just to clarify, is this a problem with all versions of Mesa or just 19.0+?
Comment 5 acc12345acc 2019-05-22 19:54:47 UTC
Apparently this bug was introduced in Mesa 19.0. (there also is a possibility of this not being a Mesa bug)
Comment 6 QwertyChouskie 2019-05-29 01:15:27 UTC
(In reply to acc12345acc from comment #5)
> Apparently this bug was introduced in Mesa 19.0. (there also is a
> possibility of this not being a Mesa bug)

I'm adding the regression keyword then.
Comment 7 Michel Dänzer 2019-06-07 09:00:48 UTC
I can't seem to reproduce this (with an AMD GPU and current Git master of Mesa and xserver).

When kwin_x11 freezes, can you attach gdb to it, run

 thread apply all bt

and attach the resulting output to this report? (Preferably with debugging symbols available for the relevant binaries)
Comment 8 QwertyChouskie 2019-06-07 20:29:06 UTC
(In reply to Michel Dänzer from comment #7)
> I can't seem to reproduce this (with an AMD GPU and current Git master of
> Mesa and xserver).
> 
> When kwin_x11 freezes, can you attach gdb to it, run
> 
>  thread apply all bt
> 
> and attach the resulting output to this report? (Preferably with debugging
> symbols available for the relevant binaries)

I think this was worked around in the current release of kwin-lowlatency in this commit: https://github.com/tildearrow/kwin-lowlatency/commit/73f09f6e11ce806064d0360bef1383e0779d9fa4

You will likely have to use the preceding commit to reproduce the issue: https://github.com/tildearrow/kwin-lowlatency/commit/0d38a4992c8dead4f96741033077ede50071b43e
Comment 9 Michel Dänzer 2019-06-11 08:32:29 UTC
(In reply to QwertyChouskie from comment #8)
> I think this was worked around in the current release of kwin-lowlatency in
> this commit:
> https://github.com/tildearrow/kwin-lowlatency/commit/
> 73f09f6e11ce806064d0360bef1383e0779d9fa4

I've tried the commit before that one as well now, still unable to reproduce.
Comment 10 QwertyChouskie 2019-06-13 02:07:58 UTC
(In reply to Michel Dänzer from comment #9)
> (In reply to QwertyChouskie from comment #8)
> > I think this was worked around in the current release of kwin-lowlatency in
> > this commit:
> > https://github.com/tildearrow/kwin-lowlatency/commit/
> > 73f09f6e11ce806064d0360bef1383e0779d9fa4
> 
> I've tried the commit before that one as well now, still unable to reproduce.

tildearrow, can you give detailed repro steps?
Comment 11 QwertyChouskie 2019-06-13 02:10:42 UTC
(In reply to QwertyChouskie from comment #10)
> (In reply to Michel Dänzer from comment #9)
> > (In reply to QwertyChouskie from comment #8)
> > > I think this was worked around in the current release of kwin-lowlatency in
> > > this commit:
> > > https://github.com/tildearrow/kwin-lowlatency/commit/
> > > 73f09f6e11ce806064d0360bef1383e0779d9fa4
> > 
> > I've tried the commit before that one as well now, still unable to reproduce.
> 
> tildearrow, can you give detailed repro steps?

Whoops, missed that they were posted in a comment further down.  Here they are again for reference:

> The test case has been mentioned already. However I forgot to include reproduction steps:
> 1. Compile kwin-lowlatency (mkdir build && cd build && cmake .. && make)
> 2. Launch it with `QT_PLUGIN_PATH="$PWD/bin" ./bin/kwin_x11 --replace`
> 3. Move a window to the top left corner as quick as possible and then shake it horizontally
> 4. Keep trying until it freezes (it usually does on the first or second try)

(Just make sure to use the older commit for all testing :)
Comment 12 Michel Dänzer 2019-06-13 07:33:03 UTC
(In reply to QwertyChouskie from comment #11)
> Whoops, missed that they were posted in a comment further down.  Here they
> are again for reference:

I did follow those steps.
Comment 13 QwertyChouskie 2019-06-13 18:16:23 UTC
(In reply to Michel Dänzer from comment #12)
> (In reply to QwertyChouskie from comment #11)
> > Whoops, missed that they were posted in a comment further down.  Here they
> > are again for reference:
> 
> I did follow those steps.

At this point tildearrow will have to weigh in.
Comment 14 GitLab Migration User 2019-09-18 17:46:12 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/118.

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.