Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 21:20:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        java@FreeBSD.org
Subject:   [Bug 225054] java/openjdk* : fails to build with clang 6.0 (blocks 571 ports)
Message-ID:  <bug-225054-8522-Nv0GwxpYFG@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225054-8522@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225054-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225054

--- Comment #10 from Dimitry Andric <dim@FreeBSD.org> ---
(In reply to Dimitry Andric from comment #9)
> So the address of the _hash_value field is OK, apparently.  As to why this
> gives a segfault, no idea yet.

Actually, it is quite clear: the memory is read-only.=20
openjdk/hotspot/src/share/vm/utilities/nativeCallStack.cpp has:

28      #include "utilities/nativeCallStack.hpp"
29
30      const NativeCallStack NativeCallStack::EMPTY_STACK(0, false);
31
32      NativeCallStack::NativeCallStack(int toSkip, bool fillStack) :
33        _hash_value(0) {
34

I.e. NativeCallStack::EMPTY_STACK is const, and placed into .rodata.  Then
openjdk/hotspot/src/share/vm/services/memTracker.cpp has:

70        // Construct NativeCallStack::EMPTY_STACK. It may get constructed
twice,
71        // but it is benign, the results are the same.
72        ::new ((void*)&NativeCallStack::EMPTY_STACK) NativeCallStack(0,
false);

This new invocation cannot work, because it tries to re-initialize a const
object.  Why this worked in previous clang, or in any other compiler, I don=
't
know. :)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225054-8522-Nv0GwxpYFG>