desktop app crashed when i switched inputs on my monitor away and back (possibly not the cause)

Bug #1781298 reported by Matthew Stone
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Xfce4 Desktop
Fix Released
Medium
xfdesktop4 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Running nightly 18.10 ubuntu studio live CD

ProblemType: Crash
DistroRelease: Ubuntu 18.10
Package: xfdesktop4 4.13.2-0ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-23.25-lowlatency 4.15.18
Uname: Linux 4.15.0-23-lowlatency x86_64
ApportVersion: 2.20.10-0ubuntu5
Architecture: amd64
CasperVersion: 1.394
CurrentDesktop: XFCE
Date: Wed Jul 11 22:56:40 2018
ExecutablePath: /usr/bin/xfdesktop
LiveMediaBuild: Ubuntu-Studio 18.10 "Cosmic Cuttlefish" - Alpha amd64 (20180709)
ProcCmdline: xfdesktop
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SegvAnalysis:
 Segfault happened at: 0x7f83677d5c31 <g_type_check_instance_is_fundamentally_a+49>: movzbl 0x14(%rdx),%eax
 PC (0x7f83677d5c31) ok
 source "0x14(%rdx)" (0x69463a3a74584588) not located in a known VMA region (needed readable region)!
 destination "%eax" ok
SegvReason: reading unknown VMA
Signal: 11
SourcePackage: xfdesktop4
StacktraceTop:
 g_type_check_instance_is_fundamentally_a () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
 g_object_ref () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
 g_task_new () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
 ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
 g_input_stream_read_async () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
Title: xfdesktop crashed with SIGSEGV in g_type_check_instance_is_fundamentally_a()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Matthew Stone (djspacecat) wrote :
Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceTop.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in xfdesktop4 (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
In , Pmenzel+bugzilla-xfce-org (pmenzel+bugzilla-xfce-org) wrote :
Download full text (5.3 KiB)

Created attachment 7886
Full backtrace acquired with `bt f` in GDB

With Xfdesktop 4.13.2, turning the tiled/MST monitor Dell UP3214Q off and back on, there is the segmentation fault below.

#0 0x00007f3c8e734677 in g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x69506b6447203a29, fundamental_type=fundamental_type@entry=80)
    at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gtype.c:4023
4023 /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gtype.c: No such file or directory.

(gdb) bt
#0 0x00007f3c8e734677 in g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0x69506b6447203a29, fundamental_type=fundamental_type@entry=80) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gtype.c:4023
#1 0x00007f3c8e713e4e in g_object_ref (_object=_object@entry=0x69506b6447203a29) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gobject/gobject.c:3206
#2 0x00007f3c8f79c848 in g_task_new (source_object=source_object@entry=0x952b90, cancellable=cancellable@entry=0x69506b6447203a29, callback=callback@entry=0x7f3c8f774b70 <async_ready_callback_wrapper>, callback_data=callback_data@entry=0x73dd10) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/gtask.c:698
#3 0x00007f3c8f774e0f in g_input_stream_real_read_async (stream=0x952b90 [GLocalFileInputStream], buffer=0x2d66756278, count=32768, io_priority=300, cancellable=0x69506b6447203a29, callback=0x7f3c8f774b70 <async_ready_callback_wrapper>, user_data=0x73dd10) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/ginputstream.c:1383
#4 0x00007f3c8f773f52 in g_input_stream_read_async (stream=stream@entry=0x952b90 [GLocalFileInputStream], buffer=0x2d66756278, count=count@entry=32768, io_priority=io_priority@entry=300, cancellable=0x69506b6447203a29, callback=callback@entry=0x421650 <xfce_backdrop_file_input_stream_ready_cb>, user_data=0x73dd10) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/ginputstream.c:633
#5 0x00000000004216ed in xfce_backdrop_file_input_stream_ready_cb (source_object=0x952b90 [GLocalFileInputStream], res=0x6ffbb0, user_data=0x73dd10) at /scratch/local/bee-root/xfdesktop/xfdesktop-4.13.2-0/source/src/xfce-backdrop.c:2013
#6 0x00007f3c8f774b9a in async_ready_callback_wrapper (source_object=0x952b90 [GLocalFileInputStream], res=0x6ffbb0, user_data=0x73dd10) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/ginputstream.c:532
#7 0x00007f3c8f79c4c3 in g_task_return_now (task=0x6ffbb0 [GTask]) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/gtask.c:1148
#8 0x00007f3c8f79c4f9 in complete_in_idle_cb (task=0x6ffbb0) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/gio/gtask.c:1162
#9 0x00007f3c8e435705 in g_main_dispatch (context=0x684510) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3177
#10 0x00007f3c8e435705 in g_main_context_dispatch (context=context@entry=0x684510) at /scratch/local/bee-root/glib2/glib2-2.56.1-0/source/glib/gmain.c:3830
#11 0x00007f3c8e435aa8 in g_main_context_iterate (context=0x684510, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /scratch/local/bee-root/glib2/glib2-2.56....

Read more...

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

I noticed this bug a while ago, xfdesktop crashes when I close/open my laptop lid.
It segfaults at https://git.xfce.org/xfce/xfdesktop/tree/src/xfce-backdrop.c?id=49a527bc928d776e497ee45e0a458e97bf8e234c#n2012 something fishy is passed to gdk_pixbuf_loader_write then gdk_pixbuf chokes.
Needs further investigation...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfdesktop4 (Ubuntu):
status: New → Confirmed
C de-Avillez (hggdh2)
information type: Private → Public
Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

*** Bug 14002 has been marked as a duplicate of this bug. ***

Changed in xfdesktop:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

*** Bug 14927 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

Created attachment 8203
possible-fix.patch

The attached patch stops the crashes for me (on lid close), Paul can you give it a try?

Explanation:
Pixbufs for backdrops are loaded asynchronously, for some reason when the signal "size-prepared"is fired the backdrop may be still invalid, but later another signal will be fired and it will be valid, but it now it's too late because on first try the data has been released. This patch skips data clean-up on cases the backdrop is invalid. I also included a couple of prints just to be check if it behaves as expected (invalid -> valid -> unref).

I'm just not sure if this is a proper fix, maybe the moment that signal is fired changed between gtk2/gtk3, no idea.
Another interesting thing I found is that the backdrop is reloaded when I close the lid, that happens due a callback to GdkScreen's "monitors-changed" signal, which is fired twice :/

Revision history for this message
In , Martin Mokrejs (mmokrejs-t) wrote :
Download full text (4.7 KiB)

Hi Andre,
   I applied the patch to xfdesktop-4.13.2 on my Gentoo Linux. After a brief testing I have indeed no new core dumps in my /var/dumps/, great. I realized that if I use Fn+F1 to use only my external HDMI display and to turn off the laptop's internal LCD, after lid open my laptop has again enabled LCD screen and using the size of the external HDMI display (1920x1200 instead of its own max 1366x768). I do not recall seeing this before. Could this be caused by your patch?

$ dmesg
[ 746.362842] [7102]: Lid closed.
[ 754.655963] [7102]: Lid opened.
[ 765.975115] [7102]: Lid closed.
[ 1256.930836] [7102]: Lid opened.
[ 4909.671002] [7102]: Lid closed.
[ 4914.565392] [7102]: Lid opened.
[ 4940.668204] [7102]: Lid closed.
[ 4948.342004] [7102]: Lid opened.
$

Maybe some checksum could be logged too so one could better discern when the event triggered and to better match it so .xsession-errors file contents? In the below log the messages around "Negative content width -1" were supposedly caused by libreoffice which remembers position o the window from a last execution and placed the window on my laptop indeed somewhere above the left upper corner. I assume that is because it remembered position from my 1920x1200 external HDMI screen while at the moment I was using laptop's internal 1366x768 screen. As there is no "Move window" place around the window luckily the only way to get to the menu of the window is to use "Maximize window" from the Xfce panel.

Anyway, the logged events you added in the patch should bear a timestamp (see below).

$ cat ~/.xsession-errors
/usr/bin/startxfce4: X server already running on display :0
gpg-agent[7061]: WARNING: "--write-env-file" is an obsolete option - it has no effect
gpg-agent[7062]: gpg-agent (GnuPG) 2.2.12 started

(xfce4-session:7009): xfce4-session-WARNING **: 11:12:38.070: gpg-agent returned no PID in the variables

(xfsettingsd:7085): xfsettingsd-WARNING **: 11:12:40.634: Property "/Gdk/WindowScalingFactor" has an unsupported type "guint".

** (xfdesktop:7089): WARNING **: 11:12:41.636: Thumbnailer failed calling GetFlavors

(xfsettingsd:7085): xfsettingsd-CRITICAL **: 11:12:42.185: Stored Xfconf properties disable all outputs, aborting.
Warning: Unsupported high keycode 372 for name <I372> ignored
                  X11 cannot support keycodes above 255.
                  This warning only shows for the first high keycode.
GNOME_KEYRING_CONTROL=/home/mmokrejs/.cache/keyring-SJ6YUZ
SSH_AUTH_SOCK=/home/mmokrejs/.cache/keyring-SJ6YUZ/ssh
Warning: Unsupported high keycode 372 for name <I372> ignored
                  X11 cannot support keycodes above 255.
                  This warning only shows for the first high keycode.
Warning: Unsupported high keycode 372 for name <I372> ignored
                  X11 cannot support keycodes above 255.
                  This warning only shows for the first high keycode.

(wrapper-2.0:7146): Gtk-WARNING **: 11:12:44.220: gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 26

(wrapper-2.0:7147): Gtk-WARNING **: 11:12:44.222: gtk_widget_size_allocate(): attempt to allocate widget with width -1 and height 28...

Read more...

Revision history for this message
In , Martin Mokrejs (mmokrejs-t) wrote :

BTW, this would be maybe more helpful:

$ dmesg | grep 7102
[ 160.994295] [7102]: New seat seat0.
[ 160.995762] [7102]: Watching system buttons on /dev/input/event3 (Power Button)
[ 161.037199] [7102]: Watching system buttons on /dev/input/event1 (Power Button)
[ 161.040300] [7102]: Watching system buttons on /dev/input/event0 (Lid Switch)
[ 161.040414] [7102]: Watching system buttons on /dev/input/event2 (Sleep Button)
[ 161.347041] [7102]: Watching system buttons on /dev/input/event5 (AT Translated Set 2 keyboard)
[ 746.362842] [7102]: Lid closed.
[ 754.655963] [7102]: Lid opened.
[ 765.975115] [7102]: Lid closed.
[ 1256.930836] [7102]: Lid opened.
[ 4909.671002] [7102]: Lid closed.
[ 4914.565392] [7102]: Lid opened.
[ 4940.668204] [7102]: Lid closed.
[ 4948.342004] [7102]: Lid opened.
$

Why not logging in a UNIX process name instead of its PID?

Revision history for this message
In , Martin Mokrejs (mmokrejs-t) wrote :

When I have only external HDMI enabled and close my laptop and turn off the external HDMI screen, upon lid open I get:

(xfsettingsd:7085): xfsettingsd-CRITICAL **: 12:58:04.247: Failed to apply display settings
UNREF LOADER

(note only one UNREF LOADER message).

Then after turning on the external HDMI and Fn+F1 to use only external HDMI screen I get the second:

UNREF LOADER

line into the .xsession-errors file. Supposedly because the laptops internal LCD was just turned off (anyway, it had the wrong size 1920x1200 since the lid open).

The message " Failed to apply display settings" should be clearer and mention which display it was looking for.

Revision history for this message
In , Martin Mokrejs (mmokrejs-t) wrote :
Download full text (3.5 KiB)

Hi,
  sorry to bug you again. I let the laptop with external HDMI enabled and internal LCD disabled. After a while external HDMI felt asleep into stand-by mode. But, I could not wake up a screen when touching my keyboard. Not even ctrl+alt+f1 helped (which usually brings me into framebuffer console out off the X11 windows and hence wakes up my screen). Alt+SysRq+S seemed to trigger some disk activity at least. The trick which worked was to close the lid and open again. That at least woke up the internal LCD of the laptop. Although it so far feels like a bug in this case it was better than nothing.

$ dmesg
[ 746.362842] [7102]: Lid closed.
[ 754.655963] [7102]: Lid opened.
[ 765.975115] [7102]: Lid closed.
[ 1256.930836] [7102]: Lid opened.
[ 4909.671002] [7102]: Lid closed.
[ 4914.565392] [7102]: Lid opened.
[ 4940.668204] [7102]: Lid closed.
[ 4948.342004] [7102]: Lid opened.
[ 6309.701087] [7102]: Lid closed.
[ 6317.374851] [7102]: Lid opened.
[ 6475.261162] [7102]: Lid closed.
[ 6483.982278] [7102]: Lid opened.
[12216.573741] sysrq: SysRq : Emergency Sync
[12216.574043] Emergency Sync complete
[12217.030881] sysrq: SysRq : Emergency Sync
[12217.031548] Emergency Sync complete
[12217.639123] sysrq: SysRq : Emergency Sync
[12217.639662] Emergency Sync complete
[12218.115483] sysrq: SysRq : Emergency Sync
[12218.115983] Emergency Sync complete
[12218.462908] sysrq: SysRq : Emergency Sync
[12218.463291] Emergency Sync complete
[12219.533405] sysrq: SysRq : Emergency Sync
[12219.533861] Emergency Sync complete
[12228.142422] [7102]: Lid closed.
[12232.069871] [7102]: Lid opened.
$

  I pressed Fn+F1 and the only available display was the internal LCD. I closed the xfce application. Here is more info. Interestingly, xrandr is still thinking current display size is 1920 x 1200 instead of actual 1366x768.

$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1366x768 60.05*+ 40.01
   1280x720 59.74
   1024x768 60.00
   1024x576 60.00 59.90 59.82
   960x540 60.00 59.63 59.82
   800x600 60.32 56.25
   864x486 60.00 59.92 59.57
   640x480 59.94
   720x405 59.51 60.00 58.99
   680x384 60.00
   640x360 59.84 59.32 60.00
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
$

$ xrandr --listmonitors
Monitors: 1
 0: +*LVDS1 1366/340x768/190+0+0 LVDS1
$ xrandr --listactivemonitors
Monitors: 1
 0: +*LVDS1 1366/340x768/190+0+0 LVDS1
$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x47 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:Intel
$

And because I had 'tail -f .xsession-errors' running here is an update:

UNREF LOADER

(xfsettingsd:7085): xfsettingsd-CRITICAL **: 14:33:52.482: Failed to apply display settings
UNREF LOADER

(xfwm4:7063): xfwm4-WARNING...

Read more...

Revision history for this message
In , Martin Mokrejs (mmokrejs-t) wrote :

Created attachment 8210
Xorg.0.log

Running on vanilla 4.18.20 kernel.

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

Thanks Martin for testing my patch, I'm glad it fixed the problem for you.

With regards to the screen size issues you are facing, I'm 99.9% sure it's not caused by xfdesktop, but xfce4-settings. Have you tried reverting the patch or even disabling xfdesktop (xfdesktop -Q)? I'm confident the behavior will be the same.

Also, have a look at recent improvements to screen management made by Simon: https://simon.shimmerproject.org/

Revision history for this message
In , Timo Teräs (fabled) wrote :

For me the crash happens reliably when the display is put to power off state (e.g. xrandr --output eDP1 --off). The attached patch fixes the issue for rme too.

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :
Changed in xfdesktop:
status: Confirmed → Fix Released
Revision history for this message
Sean Davis (bluesabre) wrote :

Fixed back in 2019. Marking as resolved.

Changed in xfdesktop4 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.