Bug 348834

Summary: DrKonqi left multiple copies of KWin running after creating bugreports
Product: [Applications] drkonqi Reporter: Dennis Schridde <heri+kde>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kwin-bugs-null, mail
Priority: NOR    
Version: 5.3.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=349921
https://bugs.kde.org/show_bug.cgi?id=353428
Latest Commit: Version Fixed In: 5.6
Sentry Crash Report:
Attachments: Screenshot

Description Dennis Schridde 2015-06-07 13:39:12 UTC
On my system there are multiple fighting copies of KWin 5.3.1 (see attached screenshot). I started some myself from various consoles using `kwin_x11 --replace &` and others from KCrash dialogues.

Reproducible: Always




$ emerge --info kwin kwindowsystem
Portage 2.2.20 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-4.9.2, glibc-2.20-r2, 4.0.4-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.4-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_5000+-with-gentoo-2.2
KiB Mem:     6097496 total,     85168 free
KiB Swap:    7813116 total,   7802688 free
Timestamp of repository gentoo: Sun, 07 Jun 2015 11:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
ccache version 3.2.2 [disabled]
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/ccache:          3.2.2::gentoo
dev-util/cmake:           3.2.3::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.16.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /var/cache/portage/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

sage-on-gentoo
    location: /var/lib/layman/sage-on-gentoo
    sync-type: laymansync
    sync-uri: git://github.com/cschwan/sage-on-gentoo.git
    masters: gentoo
    priority: 50

local
    location: /var/cache/portage/local
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-pipe -O2 -march=athlon64-sse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -O2 -march=athlon64-sse3"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --nospinner"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j2"
PKGDIR="/var/cache/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aacplus aacs acl acpi alsa amd64 avahi bash-completion bdplus berkdb bluetooth bluray branding bzip2 cairo caps cdda cddb cdio cdr celt cjk cli cracklib crypt cups cxx dbus declarative dirac dri dts dvb dvd dvdr egl emboss encode exif fam fax ffmpeg firefox flac fortran gdbm gif glamor gles gles2 gmp gpm gstreamer gtk ibus iconv ipv6 jpeg jpeg2k kde kipi ladspa latex lcms ldap libnotify libsecret lua_target_lua5-2 lv2 lz4 lzma lzo mad mmx mmxext mng modemmanager modplug modules mp3 mp4 mpeg mplayer mtp multilib mysql ncurses networkmanager nls nptl ogg openal opencl openexr opengl openmax openmp opus pam pango pch pcre pdf phonon plasma png policykit ppds pulseaudio qml qt3support qt4 qt5 readline rtmp samba scanner schroedinger sctp sdl semantic-desktop session speex spell sse sse2 ssl startup-notification subversion svg systemd tcpd theora threads tiff truetype udev udisks unicode upnp upower usb v4l vaapi vdpau vorbis vpx wavpack wayland webp widgets x264 x265 xattr xcb xcomposite xinerama xml xscreensaver xv xvid xz zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="stage words flow sheets" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3" DRACUT_MODULES="btrfs systemd" ELIBC="glibc" ENLIGHTENMENT_MODULES="*" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en en_GB ar fa" LIRC_DEVICES="devinput" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.3 3.4"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

kde-plasma/kwin-5.3.1::gentoo was built with the following:
USE="gles2 handbook wayland -debug -test" ABI_X86="64"


kde-frameworks/kwindowsystem-5.10.0::gentoo was built with the following:
USE="X nls -debug -doc -test" ABI_X86="64"
Comment 1 Dennis Schridde 2015-06-07 13:39:51 UTC
Created attachment 93054 [details]
Screenshot
Comment 2 Thomas Lübking 2015-06-07 14:20:53 UTC
Either the old instances didn't receive the XCB_SELECTION_CLEAR event (KSelectionOwner) or KSelectionOwner invalidly claims success for the new instance or the old instances perform a crash-on-exit, being stopped rather than terminated.

Can you gdb into one of the zombies and "bt" to check where it's hanging around?
Comment 3 Dennis Schridde 2015-06-07 14:24:00 UTC
I just also found a ton of stale drkonqi instances…

I submitted several bugreports against crashed KWin instances using DrKonqi, so something did not work in cleaning those up…
Comment 4 Thomas Lübking 2015-06-07 14:43:34 UTC
It's normal that DrKonqi keeps the process alive until it has at least gathered the backtrace (because otherwise it cannot) - the problem seems in DrKonqi (or involve it)

Did you see and close the DrKonqi windows?
If not, are there any DrKonqi windows (xwininfo -root -tree)
If yes, can you map them ("xdotool windowmap 0x123456" - 0x123456 ideally being the actual WId as printed by xwininfo ;-)
Comment 5 Dennis Schridde 2015-06-07 14:53:36 UTC
(In reply to Thomas Lübking from comment #4)
> It's normal that DrKonqi keeps the process alive until it has at least
> gathered the backtrace (because otherwise it cannot) - the problem seems in
> DrKonqi (or involve it)

Yes, but the bugreport was already sent in all cases, or "the application" was "restarted" (without any effect) and the dialogue closed.

> Did you see and close the DrKonqi windows?

Yes, that's where all the bugreports came from. The windows were closed after creating the bugreport. As there seemed to be a lot of repetitive backtraces, which DrKonqi did not detect as duplicates of existing reports, I just clicked "restart" for several crashes, too.

> If not, are there any DrKonqi windows (xwininfo -root -tree)

There were no DrKonqi windows left after creating the bugreports (I checked after restarting KWin manually).

When I detected the stale processes, I killed them, so I cannot check using the command you suggested right now, but I will as soon as there are stale processes again.
Comment 6 Dennis Schridde 2015-06-07 15:57:00 UTC
Some more info: On the console that I started KWin on, I get the following output when it crashes:

areKeySymXsDepressed:  any of  2
0 : keySymX=0x "ffe9"  i= 8  mask=0x "1"  keymap[i]=0x "1" 

Cant find EGLConfig, returning null config
Unable to find an X11 visual which matches EGL config 0
Could not initialize OpenGL
Application::crashHandler() called with signal 6; recent crashes: 1
KCrash: Application 'kwin_x11' crashing...
KCrash: Attempting to start /usr/lib64/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
kwin: unable to claim manager selection, another wm running? (try using --replace)

[1]+  Stopped                 DISPLAY=:0 kwin_x11 --replace
dschridde@ernie ~ $ 
dschridde@ernie ~ $ exit
There are stopped jobs.
dschridde@ernie ~ $ fg
DISPLAY=:0 kwin_x11 --replace

^C^C^C^C^C^C^C^C^A2Killed

Now apparently the process transitions to the Stopped state (without any DrKonqi window), and when resuming it (using "fg"), it will not react anymore at all, until it receives SIGKILL.
Comment 7 Thomas Lübking 2015-06-08 18:52:07 UTC
The process stops on crash to allow dr konqui to attach to it - that's normal.

DrKonqi not showing up is of course a problem - if it cannot be started, the process should of course be continued (into death)

About "not react at all" - yes, it's stopped ;-)
Does it (though I hope you don't suffer too much from this) "react" (and die) if you "kill -SIGCONT" it?
Comment 8 Dennis Schridde 2015-06-08 19:56:43 UTC
(In reply to Thomas Lübking from comment #7)
> Does it (though I hope you don't suffer too much from this) "react" (and
> die) if you "kill -SIGCONT" it?

Now that the original bug is fixed, it is more difficult to test this. But I'll try next time I run into similar trouble. What you say is sensible, of course, so I assume the reason it does not react to ^C is that it is stopped.
Comment 9 Thomas Lübking 2016-01-14 23:18:49 UTC
Git commit 69aa80750f8d61a5db6311c33751461041a260d5 by Thomas Lübking.
Committed on 14/01/2016 at 22:40.
Pushed by luebking into branch 'master'.

force restart on crash

We don't want to actively release claims on segfaults, but then
drkonqi can stop us while we're still holding the WM privs.

=> If KWin performs a crash-restart, it forcefully takes WM privs
(since the old instance shall be replaced for quite sure)
Related: bug 353030, bug 353428

REVIEW: 126741
FIXED-IN: 5.6

M  +3    -2    main_x11.cpp

http://commits.kde.org/kwin/69aa80750f8d61a5db6311c33751461041a260d5