[9] RFR of 8140630: java/nio/Buffer/Basic.java crashes vm on linux-x64 using latest devkit to build
Martin Buchholz
martinrb at google.com
Wed Nov 4 22:12:49 UTC 2015
At Google, we've also noticed crashes in Bits.c with recent gcc.
Adding nio-dev, since this is not really a build problem.
It appears that Bits.c is resorting to undefined behavior, even though
there is a long tradition of unaligned access on x86 being permitted by the
hardware.
My colleague Alexander Smundak has also been looking at this, and is trying
to actually fix Bits.c.
I've also been thinking about this a little. When compiling on x86 with
gcc, we might want to use attribute(aligned(...)) to keep gcc from making
unwarranted assumptions about alignment.
I think Andrew Haley has also been thinking about efficient array/buffer
operations?
On Wed, Nov 4, 2015 at 12:56 PM, Brian Burkhalter <
brian.burkhalter at oracle.com> wrote:
> Please review at your convenience.
>
> Issue: https://bugs.openjdk.java.net/browse/JDK-8140630
> Patch: Included below
>
> The change is to compile src/java.base/share/native/libjava/Bits.c only
> into libjava.so with normal optimization level (-O2) instead of high
> optimization level (-O3). The other objects in libjava are not affected.
> This is for 64-bit Linux only. With this patch applied,
> java/nio/Buffer/Basic.java now passes on all platforms and there is no
> crash.
>
> Thanks,
>
> Brian
>
> --- a/make/lib/CoreLibraries.gmk
> +++ b/make/lib/CoreLibraries.gmk
> @@ -139,6 +139,12 @@
> endif
> endif
>
> +ifeq ($(OPENJDK_TARGET_OS), linux)
> + ifeq ($(OPENJDK_TARGET_CPU), x86_64)
> + BUILD_LIBJAVA_Bits.c_CFLAGS := $(C_O_FLAG_NORM)
> + endif
> +endif
> +
> $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
> LIBRARY := java, \
> OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20151104/2df2f8ff/attachment.html>
More information about the nio-dev
mailing list