Bug 44614

Summary: [gl] Segmentation fault while swapping buffers without active context
Product: Mesa Reporter: Yi Sun <yi.sun>
Component: Drivers/DRI/i965Assignee: Anuj Phogat <anuj.phogat>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: bugs-fdo.8eaf7cd8e5128d8191fe
Version: git   
Hardware: Other   
OS: All   
i915 platform: i915 features:
Attachments: Piglit case to verify swapping buffers without active context.

Description Yi Sun 2012-01-10 01:28:53 UTC
System Environment:
Arch:           x86_64
Platform:       IronLake 
Libdrm: Libdrm: (master)2.4.29-3-gef20301a11afae50bfe127002913dbd0b81ddccc
Mesa:           (master)ec4851253bbf7fd7d11c5570f19f9733a885e471
Kernel:    (drm-intel-next)097354eb14fa94d31a09c64d640643f58e4a5a9a

Bug detailed description:
Rendered a triangle, then deselected the current active context. Afterwards, the segmentation fault will occur so long as swap buffer with function glXSwapBuffers.
Comment 1 Yi Sun 2012-01-10 01:32:21 UTC
Created attachment 55371 [details]
Piglit case to verify swapping buffers without active context.
Comment 2 Anuj Phogat 2012-01-11 17:33:37 UTC
I'm able to reproduce the bug. Sent out a patch on mesa-dev@lists.freedesktop.org to fix the issue.
Comment 3 Ian Romanick 2012-01-12 12:25:10 UTC
*** Bug 44361 has been marked as a duplicate of this bug. ***
Comment 4 Anuj Phogat 2012-01-16 19:00:56 UTC
Here is link for the patch pushed on mesa: http://comments.gmane.org/gmane.comp.video.mesa3d.devel/35999

commit log: 

commit dd7220652e65a8a23e7739eeee687f3d6a865b80
Author: Anuj Phogat <anuj.phogat@gmail.com>
Date:   Wed Jan 11 15:26:10 2012 -0800

    intel: Fix segfault in glXSwapBuffers with no bound context
    Calling glXSwapBuffers with no bound context causes segmentation
    fault in function intelDRI2Flush. All the gl calls should be
    ignored after setting the current context to null. So the contents
    of framebuffer stay unchanged. But the driver should not seg fault.
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44614
    Reported-by: Yi Sun <yi.sun@intel.com>
    Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Tested-by: Yi Sun <yi.sun@intel.com>
Comment 5 Yi Sun 2012-01-16 21:37:46 UTC
The patch is on the upstream.
Verified it.

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.