[Bug 225054] java/openjdk* : fails to build with clang 6.0 (blocks 571 ports)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 12 21:20:08 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225054

--- Comment #10 from Dimitry Andric <dim at 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. 
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. :)

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


More information about the freebsd-java mailing list