After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706598 - MonitorXrandr: Fix enumerating possible clone displays
MonitorXrandr: Fix enumerating possible clone displays
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.9.x
Other Linux
: High critical
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-08-22 16:55 UTC by Colin Guthrie
Modified: 2013-08-22 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MonitorXrandr: Fix segv when accessing possible_clones (1.01 KB, patch)
2013-08-22 16:59 UTC, Colin Guthrie
committed Details | Review

Description Colin Guthrie 2013-08-22 16:55:55 UTC
The enumeration of the possible clones seems incorrect and the loop overwrites the variable multiple times.

The following segv was observed:

Core was generated by `/usr/bin/gnome-shell --mode=classic'.
Program terminated with signal 11, Segmentation fault.
  • #0 meta_monitor_manager_xrandr_read_current
    at core/monitor-xrandr.c line 562
  • #0 meta_monitor_manager_xrandr_read_current
    at core/monitor-xrandr.c line 562
  • #1 read_current_config
    at core/monitor.c line 379
  • #2 meta_monitor_manager_constructed
    at core/monitor.c line 504
  • #3 g_object_new_internal
    at gobject.c line 1785
  • #4 g_object_newv
    at gobject.c line 1890
  • #5 g_object_new
    at gobject.c line 1556
  • #6 meta_monitor_manager_new
    at core/monitor.c line 492
  • #7 meta_monitor_manager_initialize
    at core/monitor.c line 1411
  • #8 meta_screen_new
    at core/screen.c line 676
  • #9 meta_display_open
    at core/display.c line 909
  • #10 meta_run
    at core/main.c line 553
  • #11 main
    at main.c line 438
$1 = (MetaOutput *) 0x2d5bc70
(gdb) print meta_output->possible_clones
$2 = (MetaOutput **) 0x53
Comment 1 Colin Guthrie 2013-08-22 16:59:04 UTC
Created attachment 252774 [details] [review]
MonitorXrandr: Fix segv when accessing possible_clones

This code requires a double pass and the segv happens later
when trying to iterate over the array.
Comment 2 Colin Guthrie 2013-08-22 17:01:55 UTC
Untested patch awaiting feedback, but it looks correct to me anyway.
Comment 3 Thierry Vignaud 2013-08-22 17:06:15 UTC
Locally tested, it fixed the issue
Comment 4 Olav Vitters 2013-08-22 20:11:15 UTC
Comment on attachment 252774 [details] [review]
MonitorXrandr: Fix segv when accessing possible_clones

<ovitters> gcampax: ok to commit https://bug706598.bugzilla-attachments.gnome.org/attachment.cgi?id=252774 ?
<gcampax> ovitters, yes
<drago01> ouch
<gcampax> btw, on what hw did you hit this?
<drago01> no idea how I didn't notice that during review
<drago01> ovitters: push
Comment 5 Olav Vitters 2013-08-22 20:11:31 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.