Bug 89562 - glXSwapIntervalMESA crashes when making use of GLX_MESA_multithread_makecurrent
Summary: glXSwapIntervalMESA crashes when making use of GLX_MESA_multithread_makecurrent
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: GLX (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 16:38 UTC by James Legg
Modified: 2019-09-18 17:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
test case (4.79 KB, text/plain)
2015-03-12 16:38 UTC, James Legg
Details

Description James Legg 2015-03-12 16:38:37 UTC
Created attachment 114264 [details]
test case

If two threads have the same current glX context, as permitted by GLX_MESA_multithread_makecurrent, then calling glXSwapIntervalMESA results in invoking dri2SetSwapInterval with the pdraw argument set to NULL. dri2SetSwapInterval then dereferences pdraw, causing a segmentation fault. The attached program reproduces this.

You can also reproduce the same crash by letting a thread exit with a context bound and then making the context current on another thread and calling glXSwapIntervalMESA there (this seems a bit dirty, but if there is no requirement to unbind GL contexts before exiting threads, then this method doesn't require GLX_MESA_multithread_makecurrent). If you add -DTEST2 to the compiler flags when compiling the attached file, this crash will be reproduced instead.

This affects at least Mesa 10.4.3, 10.5, and git master at revision 48b0a3c1c9d829a9b1d401afb2796b35df94a5d7.
Comment 1 GitLab Migration User 2019-09-18 17:44:59 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/98.


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.