Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 592292 - dev-java/icedtea-?: JDK-8140630: burpsuite: java/nio/Buffer/Basic.java crashes vm on linux-x64 using latest devkit to build
Summary: dev-java/icedtea-?: JDK-8140630: burpsuite: java/nio/Buffer/Basic.java crashe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrew John Hughes
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-28 08:47 UTC by Anton Bolshakov
Modified: 2016-12-24 09:25 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Bolshakov 2016-08-28 08:47:21 UTC
I faced a java crash with burpsuite java software where it would happen during new project creation. After some investigation I have discovered that it is an OpenJDK issue and it is fixed in JDK9. I've reported it to the vendor and they documented it here: http://blog.portswigger.net/2016/05/using-disk-based-projects-with-openjdk.html

I'm not sure what's the reason why openjdk did not applied it on earlier JDK too, but the patch is simple. It basically changes GCC optimisation from -o3 (default) to -o2 for that the affected library.

It would be good if you would it apply it.

https://github.com/pentoo/pentoo-overlay/blob/master/dev-java/icedtea/files/openjdk8-JDK-8140630.patch

--- /usr/portage/dev-java/icedtea/icedtea-3.1.0.ebuild  2016-08-04 06:45:51.000000000 +0800
+++ ./icedtea-3.1.0-r1.ebuild   2016-08-04 09:47:49.433567435 +0800
@@ -196,6 +196,11 @@
 
        # icedtea doesn't like some locales. #330433 #389717
        export LANG="C" LC_ALL="C"
+
+       #backport patch fixing memory-mapped file operations used in burpsuite in particular
+       #https://bugs.openjdk.java.net/browse/JDK-8140630
+       cp "${FILESDIR}/openjdk8-JDK-8140630.patch" patches/
+       export OPENJDK_PATCHES="${OPENJDK_PATCHES} patches/openjdk8-JDK-8140630.patch"
 }
 
 src_configure() {
-----------



emerge --info
Portage 2.2.28 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.22-r4, 4.4.8-pentoo-r1 x86_64)
=================================================================
System uname: Linux-4.4.8-pentoo-r1-x86_64-Intel-R-_Core-TM-_i5-3320M_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     7981336 total,    493236 free
KiB Swap:    4194300 total,   4180988 free
Timestamp of repository gentoo: Sat, 27 Aug 2016 07:30:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.3::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::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: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 0

pentoo
    location: /var/lib/layman/pentoo
    masters: gentoo
    priority: 1

local-overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA OPERA-12 NVIDIA-CUDA PUEL AdobeFlash-11.x Google-TOS dlj-1.1 google-chrome Oracle-BCLA-JavaSE Intel-SDP skype-4.0.0.7-copyright baudline"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
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"
ANDROID_HOME="/opt/android-sdk-update-manager"
ANDROID_SWT="/usr/share/swt-3.7/lib"
ANT_HOME="/usr/share/ant"
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"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode internal-glib python_targets_python3_4 python_targets_python2_7 multilib hardened pax_kernel pic xtpax -jit -orc"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
CAMERAS="ptp2"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
COLORFGBG="15;0"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /opt/sonar/conf /usr/share/config /usr/share/gnupg/qualified.txt"
Comment 1 James Le Cuirot gentoo-dev 2016-08-31 08:48:54 UTC
This seems more like a workaround for a bug in gcc but little was said about the actual cause. The workaround is harmless enough but I know that gnu_andrew doesn't like adding random patches to the ebuild. gnu_andrew, any chance of slipping this into the next release?
Comment 2 Andrew John Hughes 2016-09-01 00:23:27 UTC
No, because this is a hack to work around the bug.

The correct fix is:

http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/13759d57abca

I suspect the reason Oracle haven't backported it is that they work with specific compilers for certain releases, so they see GCC >= 4.9 as being tied to OpenJDK 9 and beyond. I've just finally got GCC 6 fix upstream in 8, and there was no impetus from Oracle to do so there either; it all came from others.
Comment 3 Andrew John Hughes 2016-09-01 00:24:38 UTC
And the HotSpot side:

http://hg.openjdk.java.net/jdk9/hs-rt/hotspot/rev/75f6573e9c44
Comment 4 James Le Cuirot gentoo-dev 2016-09-02 09:25:13 UTC
(In reply to Andrew John Hughes from comment #2)
> No, because this is a hack to work around the bug.
> 
> The correct fix is...

Okay so are you going to backport to these correct fixes instead? This seems like something that IcedTea ought to be doing. Presumably you'll need to for Fedora?
Comment 5 Andrew John Hughes 2016-09-02 16:10:22 UTC
I'll look into it, yes, no guarantees at this point.

I don't get your last point; I don't need anything for Fedora. I'm not a Fedora developer.
Comment 6 James Le Cuirot gentoo-dev 2016-09-02 18:39:12 UTC
(In reply to Andrew John Hughes from comment #5)
> I don't get your last point; I don't need anything for Fedora. I'm not a
> Fedora developer.

Apologies, I'm not clear on the relationship between RHEL and Fedora. I thought that the packages were derived from different versions of the same RPM spec files or something like that.
Comment 7 Andrew John Hughes 2016-09-06 20:02:57 UTC
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3159
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3160
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3161

They are, but I only work on the RHEL side. It's something we'd try and backport upstream, but don't know how open Oracle will be to it.
Comment 8 Anton Bolshakov 2016-11-20 23:51:50 UTC
I feel like this discussion goes nowhere. Gentoo is asking RHEL, RHEL is looking at Oracle and Oracle doesn't care because both oracle-jdk/jre were fixed somehow.

It looks like it might months or years the "proper" patch could be developed and accepted. Meanwhile, the important function is broken in this java machine.

Can you apply the harmless workaround first?
Comment 9 James Le Cuirot gentoo-dev 2016-11-21 14:03:58 UTC
(In reply to Anton Bolshakov from comment #8)
> I feel like this discussion goes nowhere.

Did you try 3.2.0? It was only recently added to the tree and supposedly has the fix.
Comment 10 Anton Bolshakov 2016-11-22 00:57:57 UTC
As a pleasured surprise, the bug seems fixed need. I haven't try to compile icedtea 3.2 from source, but the -bin version seems working.

I'll keep the bug open for a little longer so I could test it better.
Comment 11 Anton Bolshakov 2016-12-24 09:25:00 UTC
ok, seems fixed. Thank you!