elementary / switchboard-plug-display

Switchboard Displays Plug
https://elementary.io
GNU General Public License v3.0
14 stars 18 forks source link

Display settings crashes with some multi-display setups [$50] #104

Closed pbirkbeck closed 6 years ago

pbirkbeck commented 6 years ago

Display settings in switchboard do not open on elementary os juno

--- Did you help close this issue? Go claim the **[$50 bounty](https://www.bountysource.com/issues/60450599-display-settings-crashes-with-some-multi-display-setups?utm_campaign=plugin&utm_content=tracker%2F60457221&utm_medium=issues&utm_source=github)** on [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F60457221&utm_medium=issues&utm_source=github).
danirabbit commented 6 years ago

Thanks for the report! Can you provide some more information? What kind of display set up are you running? Internal on a laptop? External on a desktop? Multiple displays? Anything noteworthy like HiDPI on some, but not all displays? What happens when you try to open Display settings? Does it freeze or does the window just close? Do you get any error messaging?

pbirkbeck commented 6 years ago

I have a Dell XPS 13 9360 connected to Dell USB C dock with 2 external monitors with laptop lid closed. When I press displays in switchboard nothing happens and switchboard closes out. No error messages

pbirkbeck commented 6 years ago

Also I get this in syslog when pressing displays -

Jul  3 17:28:42 paulb-xps13 io.elementary.cerbere.desktop[1435]: **
Jul  3 17:28:42 paulb-xps13 io.elementary.cerbere.desktop[1435]: ERROR:linkedlist.c:1175:gee_linked_list_real_get: assertion failed: (index < this._size)
BZHDeveloper commented 6 years ago

Same thing here.

https://github.com/elementary/switchboard-plug-display/blob/master/src/Objects/VirtualMonitor.vala#L105 https://github.com/elementary/switchboard-plug-display/blob/master/src/Utils.vala#L38

unrecognized second screen, or the default config remove all modes :/

danirabbit commented 6 years ago

Thanks for the info! marking as "Confirmed" since more than one person can reproduce

btd1337 commented 6 years ago

Same problem here...

Process 30243 (switchboard) of user 1000 dumped core.

Stack trace of thread 30243:
#0  0x00007f5ccc88b86b raise (libc.so.6)
#1  0x00007f5ccc87640e abort (libc.so.6)
#2  0x00007f5cce265b76 g_assertion_message (libglib-2.0.so.0)
#3  0x00007f5cce265bdc g_assertion_message_expr (libglib-2.0.so.0)
#4  0x00007f5ccdd65d62 n/a (libgee-0.8.so.2)
#5  0x00007f5cb6c303c0 display_virtual_monitor_get_display_name (libdisplay.so)
#6  0x00007f5cb6c3615a display_display_window_construct (libdisplay.so)
#7  0x00007f5cb6c37cfb display_display_widget_construct (libdisplay.so)
#8  0x00007f5cb6c38bda display_displays_overlay_rescan_displays (libdisplay.so)
#9  0x00007f5cb6c391d7 display_displays_overlay_construct (libdisplay.so)
#10 0x00007f5cb6c39887 n/a (libdisplay.so)
#11 0x00007f5ccce2c98f n/a (libgobject-2.0.so.0)
#12 0x00007f5ccce2da7d g_object_new_with_properties (libgobject-2.0.so.0)
#13 0x00007f5ccce2e532 g_object_new (libgobject-2.0.so.0)
#14 0x00007f5cb6c30488 n/a (libdisplay.so)
#15 0x0000562e1a737222 n/a (switchboard)
#16 0x00007f5cce23e1d6 g_main_context_dispatch (libglib-2.0.so.0)
#17 0x00007f5cce23e5b1 n/a (libglib-2.0.so.0)
#18 0x00007f5cce23e8e2 g_main_loop_run (libglib-2.0.so.0)
#19 0x00007f5ccd63adcf gtk_main (libgtk-3.so.0)
#20 0x0000562e1a739e7c n/a (switchboard)
#21 0x00007f5ccce26a4d g_closure_invoke (libgobject-2.0.so.0)
#22 0x00007f5ccce39bca n/a (libgobject-2.0.so.0)
#23 0x00007f5ccce426f6 g_signal_emit_valist (libgobject-2.0.so.0)
#24 0x00007f5ccce43130 g_signal_emit (libgobject-2.0.so.0)
#25 0x00007f5ccd10d6c0 n/a (libgio-2.0.so.0)
#26 0x00007f5ccd10d8e2 g_application_run (libgio-2.0.so.0)
#27 0x0000562e1a738d99 switchboard_main (switchboard)
#28 0x00007f5ccc87806b __libc_start_main (libc.so.6)
#29 0x0000562e1a736e2a _start (switchboard)

Stack trace of thread 30245:
#0  0x00007f5ccc942ea9 __poll (libc.so.6)
#1  0x00007f5cce23e523 n/a (libglib-2.0.so.0)
#2  0x00007f5cce23e63e g_main_context_iteration (libglib-2.0.so.0)
#3  0x00007f5cce23e692 n/a (libglib-2.0.so.0)
#4  0x00007f5cce266a2a n/a (libglib-2.0.so.0)
#5  0x00007f5ccb5b4075 start_thread (libpthread.so.0)
#6  0x00007f5ccc94d53f __clone (libc.so.6)

Stack trace of thread 30247:
#0  0x00007f5ccb5b9ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1  0x00007f5cbcb3c124 n/a (i965_dri.so)
#2  0x00007f5cbcb3be18 n/a (i965_dri.so)
#3  0x00007f5ccb5b4075 start_thread (libpthread.so.0)
#4  0x00007f5ccc94d53f __clone (libc.so.6)

Stack trace of thread 30248:
#0  0x00007f5ccc9480f9 syscall (libc.so.6)
#1  0x00007f5cce28552d g_cond_wait_until (libglib-2.0.so.0)
#2  0x00007f5cce210903 n/a (libglib-2.0.so.0)
#3  0x00007f5cce210eee g_async_queue_timeout_pop (libglib-2.0.so.0)
#4  0x00007f5cce267541 n/a (libglib-2.0.so.0)
#5  0x00007f5cce266a2a n/a (libglib-2.0.so.0)
#6  0x00007f5ccb5b4075 start_thread (libpthread.so.0)
#7  0x00007f5ccc94d53f __clone (libc.so.6)

Stack trace of thread 30249:
#0  0x00007f5ccc942ea9 __poll (libc.so.6)
#1  0x00007f5cce23e523 n/a (libglib-2.0.so.0)
#2  0x00007f5cce23e63e g_main_context_iteration (libglib-2.0.so.0)
#3  0x00007f5c9d74bf4e n/a (libdconfsettings.so)
#4  0x00007f5cce266a2a n/a (libglib-2.0.so.0)
#5  0x00007f5ccb5b4075 start_thread (libpthread.so.0)
#6  0x00007f5ccc94d53f __clone (libc.so.6)

Stack trace of thread 30246:
#0  0x00007f5ccc942ea9 __poll (libc.so.6)
#1  0x00007f5cce23e523 n/a (libglib-2.0.so.0)
#2  0x00007f5cce23e8e2 g_main_loop_run (libglib-2.0.so.0)
#3  0x00007f5ccd13b348 n/a (libgio-2.0.so.0)
#4  0x00007f5cce266a2a n/a (libglib-2.0.so.0)
#5  0x00007f5ccb5b4075 start_thread (libpthread.so.0)
#6  0x00007f5ccc94d53f __clone (libc.so.6)
tlitovsk commented 6 years ago

Only happens with 2 external displays. 1 External display works fine. Jul 18 10:23:32 tolik-Aspire-V3-372 io.elementary.cerbere.desktop[3060]: ** Jul 18 10:23:32 tolik-Aspire-V3-372 io.elementary.cerbere.desktop[3060]: ERROR:linkedlist.c:1175:gee_linked_list_real_get: assertion failed: (index < this._size)

tlitovsk commented 6 years ago

Here is a temporary workaround https://christian.amsuess.com/tools/arandr/ Although doesn't have the elementary good looks :-)

btd1337 commented 6 years ago

It confirmed. This error occurs just when we use an external monitor.

cassidyjames commented 6 years ago

@btd1337 there is no need to ping people not already on this issue; it's been confirmed, triaged, marked as high priority, and assigned to the beta2 milestone. If there is further work on it, that will show up on this issue (and notify anyone who has notifications on for the issue).

cassidyjames commented 6 years ago

@danrabbit and I both experienced this with a specific display this weekend. We are both on HiDPI, and were connecting to a projector that had an HDMI extender. But I've also connected to a different display just fine and it doesn't crash. So I'm not sure what's causing it exactly, or how exactly to reproduce it.

naaando commented 6 years ago

It's crashing because there's no boundary checking on VirtualMonitor.monitors, MonitorManager's get_monitor_config() have a foreach loop around line 178 that might append virtual monitors without monitors, I didn't find a solution atm tho. This should be production ready code? There's a huge chunk of code inside a single function and there's no reason to VirtualMonitor hold a monitors array since MonitorManager have a array of VirtualMonitors too. BTW was a huge experience to track this bug with gdb, learned a lot.

davidmhewitt commented 6 years ago

I'm unable to reproduce this on my HiDPI laptop with 2 external monitors (both with and without the lid closed) and all the combinations of different monitors attached to different ports.

I'd be willing to do some remote access debugging if someone has a machine that can consistently reproduce the fault and is willing to let me remote in. Something a bit like pair programming I guess, as I'd probably look to test out a few code changes on the same machine.

cassidyjames commented 6 years ago

@davidmhewitt I think @Philip-Scott was saying it was pretty reproducible for him at home. Unfortunately the situation with me and @danrabbit was at a conference venue, so we don't have access to that hardware anymore. I'll see if I can get it to consistently reproduce here with an old monitor or something, though, and let you know.

naaando commented 6 years ago

Guys more update on tracking the issue, apparently the serial isn't being attributed for some devices, I've made a hash joining connector+vendor+product+serial. IDK if this hash could change but I guess it's safe to use, sending PR #120

Philip-Scott commented 6 years ago

Fixed in #121 :)