Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 561500

Summary: dev-java/icedtea-7.2.6.1 graphical glitches relating to leaky shm segments
Product: Gentoo Linux Reporter: Mike Nerone <mike>
Component: [OLD] JavaAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal CC: alex, alexander, dimgel, felipematas, gentoo.2019, gokturk, jeremy.william.murphy, kripton, pacho, stefan.heinsen
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugs.kde.org/show_bug.cgi?id=350976
See Also: https://bugs.gentoo.org/show_bug.cgi?id=561104
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: files/7-xshm-fix.patch
icedtea-7.2.6.1-r1.ebuild.patch

Description Mike Nerone 2015-09-25 21:15:37 UTC
I am experiencing the glitching reported to KDE for multiple distros (including another Gentoo user) at https://bugs.kde.org/show_bug.cgi?id=350976. Another user there reports that OpenJDK-1.8 resolves the problem, but we don't have dev-java/icedtea:8 in the java overlay at this time.

Portage 2.2.20.1 (python 3.4.1-final-0, default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.8.5, glibc-2.20-r2, 4.0.5-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.5-gentoo-x86_64-Intel-R-_Core-TM-_i7-3840QM_CPU_@_2.80GHz-with-gentoo-2.2
KiB Mem:    32805220 total,  20148380 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 25 Sep 2015 06:00:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.4.1::gentoo
dev-util/cmake:           3.2.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.8.5::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-uri: git://github.com/pantera31752/open-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=" --with-bdeps y --binpkg-respect-use=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch 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://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed,-z,now,--hash-style=gnu,--sort-common"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
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 acl acpi aes alsa amd64 audiofile avahi avx bash-completion berkdb branding bzip2 cairo caps cdaudio cdda cddb cdio cdparanoia cdr cleartype cli cracklib crypt css cups curl cxx dbus declarative dri dts dv dvd dvdr dvdread efi emboss encode exif faad fam fame fastcgi fat fbsplash fdk ffmpeg fftw firefox flac fortran ftp gd gdbm geoip gif git glamor glib glut gmp gnutls gphoto2 gpm gtk hbci iconv icu idn imagemagick imap imlib ipv6 ithreads jack javascript jfs jpeg kde kdehiddenvisibility kipi lame laptop lcms libnotify lighttpd live lzo mad matroska mcal memlimit mjpeg mmap mmx mmxext mng modules mozilla mp3 mp4 mpeg multilib musepack musicbrainz ncurses network networkmanager nls nntp nptl nsplugin ntfs offensive ofx ogg openexr opengl opus pam pango pch pcre pdf phonon physfs plasma png policykit popcnt postgres ppds pulseaudio python python3 qt3support qt4 rackspace rdesktop readline real reiserfs resolvconf rtc schroedinger sdl seccomp semantic-desktop session slp speex spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification streaming svg symlink syslog systemd taglib theora threads threadsafe thunderbird tidy tiff tk truetype udev udisks unicode upnp upower usb utempter utf8 v4l vaapi vcd vhosts video vim-syntax vnc vorbis webdav win32codecs wps wxwidgets x264 xattr xcb xcomposite xinerama xml xosd xscreensaver xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias auth_basic authn_alias authn_default authn_file authz_default authz_groupfile authz_host authz_user autoindex dav dav_fs dir env expires headers include info log_config mime mime_magic negotiation proxy proxy_http rewrite setenvif status unique_id" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="directory" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" 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" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" NERONE_USERS="mike" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel nvidia" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

dev-java/icedtea-7.2.6.1::gentoo was built with the following:
USE="alsa awt cups gtk javascript jbootstrap nsplugin pulseaudio sunec webstart -cacao -cjk -debug -doc -examples -infinality -jamvm -kerberos -nss -pax_kernel -sctp (-selinux) -smartcard -source -test -zero" ABI_X86="64"
Comment 1 James Le Cuirot gentoo-dev 2015-09-25 21:23:26 UTC
(In reply to Mike Nerone from comment #0)
> Another user there reports that
> OpenJDK-1.8 resolves the problem, but we don't have dev-java/icedtea:8 in
> the java overlay at this time.

Actually we do but it's called icedtea-3 because upstream wants us to use their versioning. It's a prerelease though and the current ebuild is outdated. It probably won't fetch properly now.

If you hear of any other workarounds, please let us know.
Comment 2 Robert G. Siebeck 2015-09-29 21:25:22 UTC
I'm also affected by this problem. Possible workaround is using another JDK (for example oracle-jdk-bin)
Comment 3 Mike Nerone 2015-09-30 19:35:02 UTC
Yes, that's true. To my knowledge, only OpenJDK/icedtea exhibits this issue (one person in the KDE bug claims Oracle's does, as well, but I suspect that the wrong jre/jdk is actually selected).
Comment 4 Jeremy Murphy 2015-10-01 04:51:01 UTC
*** Bug 561710 has been marked as a duplicate of this bug. ***
Comment 5 Andrew John Hughes 2015-10-03 05:05:11 UTC
(In reply to James Le Cuirot from comment #1)
> (In reply to Mike Nerone from comment #0)
> > Another user there reports that
> > OpenJDK-1.8 resolves the problem, but we don't have dev-java/icedtea:8 in
> > the java overlay at this time.
> 
> Actually we do but it's called icedtea-3 because upstream wants us to use
> their versioning. It's a prerelease though and the current ebuild is
> outdated. It probably won't fetch properly now.
> 
> If you hear of any other workarounds, please let us know.

It's slotted as 8 though, so icedtea:8 works. I emerged it as that just today.

The ebuild has been updated to pre06 which uses 8u60-b24. Testing is welcomed so we can make sure the final release is as good as possible.
Comment 6 Andrew John Hughes 2015-10-03 05:06:55 UTC
(In reply to Mike Nerone from comment #3)
> Yes, that's true. To my knowledge, only OpenJDK/icedtea exhibits this issue
> (one person in the KDE bug claims Oracle's does, as well, but I suspect that
> the wrong jre/jdk is actually selected).

As far as I can tell from https://bugs.kde.org/show_bug.cgi?id=350976, two completely different versions are being compared; OpenJDK/IcedTea 7 vs. proprietary Oracle binaries for 8. Try emerging icedtea:8 from java-overlay and see if this solves the issue.

It seems likely that a fix needs backporting from 8 to 7 to fix this there, but there's not enough info here to tell what that might be.
Comment 7 Mike Nerone 2015-10-07 19:32:30 UTC
I've been using dev-java/icedtea-3.0.0_pre06 for about an hour now with no hiccups nor any glitching. I'll continue to use it and report back if it returns.
Comment 8 Alexander Tsoy 2015-10-08 14:43:18 UTC
I launched an IP-KVM java applet and here what I see:

$ sudo ipcs -m -p | awk '{print $3}' | sort | uniq -c | sort -n
      1 1408
      1 1526
      1 cpid
      1 Memory
      2 
      3 1778
      3 1898
      3 3856
    780 4339
$ ps www 4339
  PID TTY      STAT   TIME COMMAND
 4339 tty2     Sl+    1:17 /etc/java-config-2/current-icedtea-web-vm/bin/java -Xbootclasspath/a:/usr/share/icedtea-web/netx.jar:/usr/share/icedtea-web/plugin.jar:no -classpath /opt/icedtea-bin-7.2.6.1/jre/lib/rt.jar sun.applet.PluginMain /run/user/1000/icedteaplugin-puleglot-1pHWZM/4332-icedteanp-plugin-to-appletviewer /run/user/1000/icedteaplugin-puleglot-1pHWZM/4332-icedteanp-appletviewer-to-plugin /run/user/1000/icedteaplugin-puleglot-1pHWZM/4332-icedteanp-plugin-debug-to-appletviewer


The number of shared memory segments used by this java process constantly grows:

$ sudo ipcs -m -p | awk '{print $3}' | sort | uniq -c | grep 4339
    839 4339
...
$ sudo ipcs -m -p | awk '{print $3}' | sort | uniq -c | grep 4339
    865 4339


The default limit for a number of shared memory segments:

$ sudo sysctl kernel.shmmni
kernel.shmmni = 4096
Comment 9 Alexander Tsoy 2015-10-08 20:05:53 UTC
I applied the patch from [1] to icedtea-7.2.6.1 and java stopped leaking shm segments. ^_^ This should also fix problems with QT, alsa, etc.

[1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2568
Comment 11 James Le Cuirot gentoo-dev 2015-10-08 21:20:16 UTC
(In reply to Alexander Tsoy from comment #9)
> I applied the patch from [1] to icedtea-7.2.6.1 and java stopped leaking shm
> segments. ^_^ This should also fix problems with QT, alsa, etc.
> 
> [1] http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2568

Thanks, I am attempting to build icedtea with a revised ebuild now and will check the result in the morning, though I'm not aware of any simple way to reproduce the problem. I don't use KDE. If everything looks good, I'll commit the result tomorrow but I don't wish to apply it to icedtea-bin. That's a lot of work and it probably won't be too long before the next release.
Comment 12 Alexander Tsoy 2015-10-09 00:27:24 UTC
(In reply to James Le Cuirot from comment #11)
> Thanks, I am attempting to build icedtea with a revised ebuild now and will
> check the result in the morning,

I'll attach patches from my local overlay, just in case.

> though I'm not aware of any simple way to reproduce the problem.

Just start any java application with GUI and see how it's leaking shared memory.

> I don't use KDE.

Me too. :)
Comment 13 Alexander Tsoy 2015-10-09 00:28:16 UTC
Created attachment 414164 [details, diff]
files/7-xshm-fix.patch
Comment 14 Alexander Tsoy 2015-10-09 00:30:19 UTC
Created attachment 414166 [details, diff]
icedtea-7.2.6.1-r1.ebuild.patch
Comment 15 Mike Nerone 2015-10-09 08:31:52 UTC
I've tested with alexander's ebuild/patch from #12, #13, and #14, and so far, it does, indeed, appear to resolve the glitching in KDE.
Comment 16 Alex Xu (Hello71) 2015-10-09 13:43:59 UTC
*** Bug 561610 has been marked as a duplicate of this bug. ***
Comment 17 jannis 2015-10-09 20:06:03 UTC
Same here, dup of https://bugs.gentoo.org/show_bug.cgi?id=560268

See also https://bugs.archlinux.org/task/45824
Comment 18 James Le Cuirot gentoo-dev 2015-10-10 22:19:25 UTC
*** Bug 560268 has been marked as a duplicate of this bug. ***
Comment 19 Andrew Savchenko gentoo-dev 2015-10-10 22:20:38 UTC
*** Bug 561104 has been marked as a duplicate of this bug. ***
Comment 20 James Le Cuirot gentoo-dev 2015-10-10 22:32:09 UTC
Sorry for the wait. I've just committed the fix to dev-java/icedtea-7.2.6.1-r1. I took the later patch from the icedtea bug report as that seems to be the full fix, though I am admittedly a little confused about what actually happened. It does apply cleanly and the problem seems to go away. I was able to observe it with just policytool, which comes with the JDK.

I'll fix icedtea-bin if I have time but no promises. It takes ages to build on arm so it would only be for amd64 and x86.
Comment 21 jannis 2015-10-11 09:54:15 UTC
(In reply to James Le Cuirot from comment #20)
> I've just committed the fix to dev-java/icedtea-7.2.6.1-r1.

Fix confirmed working here. Thank you very much!
Comment 22 James Le Cuirot gentoo-dev 2015-10-13 20:32:14 UTC
gnu_andrew tells me the next icedtea will be out in a week or so. I'll update icedtea-bin shortly after.
Comment 23 Dmitry Grigoriev 2015-10-16 23:44:35 UTC
(In reply to James Le Cuirot from comment #20)
> I've just committed the fix to dev-java/icedtea-7.2.6.1-r1.

Works for me too for a week now. Thank you! :)
Comment 24 James Le Cuirot gentoo-dev 2015-11-03 00:08:44 UTC
*** Bug 564740 has been marked as a duplicate of this bug. ***
Comment 25 James Le Cuirot gentoo-dev 2015-11-16 22:54:19 UTC
Now fixed in icedtea-bin-7.2.6.2. ppc still needs to be stabilised but I'll close this now.