Summary: | X crashes when logging out of second display with composite | ||
---|---|---|---|
Product: | Mesa | Reporter: | Bram Verweij <amverweij> |
Component: | GLX | Assignee: | mesa-dev |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | 6.5 | ||
Hardware: | x86 (IA32) | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Patch that eliminates discepancy in allocated sizes
Fix potential out-of-bounds error |
Description
Bram Verweij
2007-11-26 07:17:37 UTC
Created attachment 12723 [details]
Patch that eliminates discepancy in allocated sizes
So, X seems to be freeing memory that it did not allocate.
Actually the problem is xorg-server-1.3.0.0/GL/mesa/X/xf86glx.c. On line 326, pXMesaVisual is allocated of size screen->base.numVisuals * sizeof(XMesaVisual). Later, it is used up till and size pScreen->numVisuals. Using a debugger, it is easy to see that these numbers need not be the same, in my case they are 8 and 9.
Created attachment 12724 [details]
Fix potential out-of-bounds error
The routine init_screen_visuals() has even more dodgy bits: i is incremented even if no visual is used. Because of that, there seems to be no guarantee that i is not incremented to beyond the end of the array. This small patch fixes that
BTW, the instruction on reproducing this on launchpad are a bit complicated. An easier way is: 1) boot the system 2) from a command-line use "startx /usr/bin/xterm -- :1" to open a new display 3) in the xterm that was just created, type "exit" and return I'm running xorg-server-1.3.0.0-r1 and mesa-6.5.2-r1 on Gentoo. -- 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/52. |
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.