Summary: | X segfault on xf86-video-modesetting whit SDL apps start runing at fullscreen in 64 bits | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Pablo Lezaeta <prflr88> | ||||||
Component: | Driver/modesetting | Assignee: | Xorg Project Team <xorg-team> | ||||||
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> | ||||||
Severity: | critical | ||||||||
Priority: | high | CC: | anihirash, peter | ||||||
Version: | unspecified | ||||||||
Hardware: | x86 (IA32) | ||||||||
OS: | Linux (All) | ||||||||
Whiteboard: | |||||||||
i915 platform: | i915 features: | ||||||||
Attachments: |
|
Description
Pablo Lezaeta
2013-05-21 03:39:05 UTC
Created attachment 79772 [details]
backtrace and variables with gdb
Confirmed, trying to start QEMU (in SDL) full-screen triggers a segfault. Backtrace attached.
Problematic source:
956 AdjustFrame(ADJUST_FRAME_ARGS_DECL)
957 {
958 SCRN_INFO_PTR(arg);
959 xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
960 xf86OutputPtr output = config->output[config->compat_output];
961 xf86CrtcPtr crtc = output->crtc;
962
963 if (crtc && crtc->enabled) {
964 crtc->funcs->mode_set(crtc, pScrn->currentMode,
^^^^^^^^
pScrn->currentMode, x,
965 y);
966 crtc->x = output->initial_x + x;
967 crtc->y = output->initial_y + y;
968 }
mode_set is not set in drmmode_display.c, static const xf86CrtcFuncsRec drmmode_crtc_funcs. If I disable this function within gdb (break AdjustFrame; return; continue), there is no crash. (but the picture is shown outside the screen boundaries, probably unrelated?)
By the way, that was Xorg 1.14.1 on Arch Linux 64-bit. Using gma500_gfx as well. Created attachment 79781 [details] [review] Prevent AdjustFrame from calling uninitialized mode_set In my tests with qemu, output->initial_x, x and crtc->x (and p;s/x/y/g) are always 0. That, and since I saw other drivers that also do nothing for AdjustFrame, I decided to strip this whole function. The code that is stripped by this patch originates from a different driver in 2008. After applying this patch, X no longer segfaults (obviously, mode_set is a NULL pointer...). In order to get the picture correctly displayed on-screen, I had to apply another quirk though. There was a ghost output device which I had to disable before starting this application. It is documented on https://wiki.archlinux.org/index.php/Poulsbo#SDL_fullscreen_viewport_is_too_large.2Fsmall I have also tried the below patch, with the same results: --- src/xf86-video-modesetting-0.7.0/src/driver.c 2013-05-25 08:35:26.372159926 +0000 +++ - 2013-05-25 08:35:31.281344995 +0000 @@ -961,10 +961,8 @@ xf86CrtcPtr crtc = output->crtc; if (crtc && crtc->enabled) { - crtc->funcs->mode_set(crtc, pScrn->currentMode, pScrn->currentMode, x, - y); - crtc->x = output->initial_x + x; - crtc->y = output->initial_y + y; + crtc->funcs->set_mode_major(crtc, pScrn->currentMode, crtc->rotation, + output->initial_x + x, output->initial_y + y); } } This problem actual for x86 too. should be fixed in master now. I'll do a release in a day or two. |
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.