GNOME Bugzilla – Bug 763023
Segfault in init_randr15()
Last modified: 2016-03-04 02:33:37 UTC
Created attachment 322948 [details] [review] A patch that fixes the problem on my computer. The pointer initialized here is, in null in some circumstances (originally tested in Debian testing, with gtk+-3.18.8, repeated with git master on March-3-2016): https://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkscreen-x11.c#n652 This leads to a segfault on line 657. The problem went away when I added the line: if (!output_info) continue;
Review of attachment 322948 [details] [review]: Hi, thanks for you patch! In GNOME we usually ask for patches generated from Git commits, either using `git format-patch` or (better) `git bz`. This allows us to easily apply the patch, and maintain the authorship information. Could you please resubmit your patch conforming to that requirement, while you fix the issue below? Thanks again! ::: gdk/x11/gdkscreen-x11.c @@ +654,3 @@ + + if (!output_info) + continue; Coding style: you should not mix declarations with statements. Also, you should use an explicit NULL comparison, i.e. if (output == NULL) continue;
Hi, thanks for the comments. I've fixed the issues you pointed out in this patch. Also, I'm not sure if it matters, but the surrounding lines !ptr to check for NULL, so I wrote my patch to fit into the context: should I submit a second patch that fixes other NULL checks?
Created attachment 322989 [details] [review] Patch that fixes the style issues mentioned
Review of attachment 322989 [details] [review]: I don't think XRRGetOutputInfo can legitimately return NULL. But better safe than sorry.
Review of attachment 322989 [details] [review]: It would be good to be a bit more specific in the commit message: what are the 'certain circumstances' ? A particular driver or X version you're seeing this with ?
I think it's related to using two graphics cards to drive three monitors. I'm running Debian testing (xserver-xorg 1:7.7+13) and it does, in fact, return NULL. FWIW, I suspect that this is related to another bug in Xorg that causes Xrandr and Xinerama to return different information about the resolution of the attached monitors.