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 725637 - gnome-shell crashed with SIGSEGV in find_output_by_key()
gnome-shell crashed with SIGSEGV in find_output_by_key()
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.10.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 727457 730214 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-04 05:46 UTC by Cristian Aravena Romero
Modified: 2014-05-15 19:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MetaMonitorConfig: don't keep a previous config with the wrong outputs (1.80 KB, patch)
2014-05-06 18:02 UTC, Giovanni Campagna
committed Details | Review
MetaMonitorConfig: don't always restore the previous config when opening the laptop lid (2.04 KB, patch)
2014-05-06 18:02 UTC, Giovanni Campagna
none Details | Review
MetaMonitorConfig: don't always restore the previous config when opening the laptop lid (2.37 KB, patch)
2014-05-06 18:06 UTC, Giovanni Campagna
committed Details | Review

Description Cristian Aravena Romero 2014-03-04 05:46:43 UTC
Open bug in launchpad.net:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1275969


"After wake-up the system just displayed this message."

  • #0 find_output_by_key
    at core/monitor-config.c line 1670
  • #1 real_assign_crtcs
    at core/monitor-config.c line 1734
  • #2 meta_monitor_config_assign_crtcs
    at core/monitor-config.c line 1805
  • #3 apply_configuration
    at core/monitor-config.c line 864
  • #4 ??
  • #5 ??

Comment 1 Giovanni Campagna 2014-03-04 13:39:15 UTC
This looks like a problem in a stored display configuration. Can you obtain the monitors.xml file of the affected user, or ask him to try reproduce the bug without that file?
Comment 2 Cristian Aravena Romero 2014-04-20 00:29:16 UTC
In launchpad.net:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1275969/comments/8
Comment 3 Giovanni Campagna 2014-05-06 18:02:38 UTC
Created attachment 276012 [details] [review]
MetaMonitorConfig: don't keep a previous config with the wrong outputs

We can only apply a configuration if its outputs match the connected
ones, so discard the current configuration if the set of output changes
(for example for hotplug), otherwise we will crash trying to apply
the bogus previous configuration.
Comment 4 Giovanni Campagna 2014-05-06 18:02:44 UTC
Created attachment 276013 [details] [review]
MetaMonitorConfig: don't always restore the previous config when opening the laptop lid

Only do it if the current configuration was actually created
as the result of closing the laptop lid.
Comment 5 Giovanni Campagna 2014-05-06 18:06:13 UTC
Created attachment 276014 [details] [review]
MetaMonitorConfig: don't always restore the previous config when opening the laptop lid

Only do it if the current configuration was actually created
as the result of closing the laptop lid.

The previous one had a small behavior change, and after some thinking
I believe it would have been buggy. This one should work fine.
Comment 6 Florian Müllner 2014-05-06 19:16:19 UTC
Review of attachment 276012 [details] [review]:

::: src/backends/meta-monitor-config.c
@@ +879,3 @@
      Also, we clear the previous configuration if the current one (which is
+     about to become previous) is stored, of if the current one has a
+     different outputs.

Typos: "of if" => "or if" and "has a different outputs" => "has different outputs"

@@ +893,3 @@
+         not their modes
+      */
+      if (self->current && config_equal (self->current, config))

If you used

  if (self->current == NULL || config_equal (self->current, config)

here, the config_free() call in the else block could be made unconditional. Could be considered a trade-off with regard to readability though.
Comment 7 Florian Müllner 2014-05-06 19:21:53 UTC
Review of attachment 276014 [details] [review]:

::: src/backends/meta-monitor-config.c
@@ +1034,2 @@
                                     manager, FALSE);
+          self->current_is_for_laptop_lid = TRUE;

Is this correct when apply_configuration() failed?
Comment 8 Giovanni Campagna 2014-05-06 19:26:15 UTC
(In reply to comment #7)
> Review of attachment 276014 [details] [review]:
> 
> ::: src/backends/meta-monitor-config.c
> @@ +1034,2 @@
>                                      manager, FALSE);
> +          self->current_is_for_laptop_lid = TRUE;
> 
> Is this correct when apply_configuration() failed?

Mh, no.
Comment 9 Giovanni Campagna 2014-05-06 19:30:08 UTC
Pushed with the suggested fixes.

I did not rework the config_equal() check, because it seems more
readable this way to me, and I trust compiler optimizations to
remove the NULL check anyway.

Attachment 276012 [details] pushed as 01cd4b2 - MetaMonitorConfig: don't keep a previous config with the wrong outputs
Attachment 276014 [details] pushed as 2ca2c18 - MetaMonitorConfig: don't always restore the previous config when opening the laptop lid
Comment 10 Giovanni Campagna 2014-05-15 19:38:37 UTC
*** Bug 730214 has been marked as a duplicate of this bug. ***
Comment 11 Giovanni Campagna 2014-05-15 19:38:47 UTC
*** Bug 727457 has been marked as a duplicate of this bug. ***