UnifiedOopRef has a single uintptr_t _value member.
UnifiedOopRef::encode_null() returns UnifiedOopRef(). That's the implicitly declared default constructor. Such a constructor is specified to not initialize such a member [1][2]. encode_null() should be written as
inline UnifiedOopRef UnifiedOopRef::encode_null() {
UnifiedOopRef result = { 0 };
return result;
}
It's probably just (questionable) luck that this hasn't shown up as crashes in the JFR leak profiler. (Or maybe it has, and I didn't find the JBS issue(s).)
[1] Such a constructor "performs the set of initializations of the class that would be performed by a user-written default constructor ... with an empty mem-initializer-list and an empty function body." (C++03 12.1/7; updated wording but otherwise similar in C++14.)
[2] If a data member is not named by a mem-initializer-id (including the case where there is no mem-initializer-list) and is not of class type, it is not initialized. (C++03 12.6.2/4; C++14 says this case is default initialized, but that's equivalent to uninitialized for the member's type.)
UnifiedOopRef::encode_null() returns UnifiedOopRef(). That's the implicitly declared default constructor. Such a constructor is specified to not initialize such a member [1][2]. encode_null() should be written as
inline UnifiedOopRef UnifiedOopRef::encode_null() {
UnifiedOopRef result = { 0 };
return result;
}
It's probably just (questionable) luck that this hasn't shown up as crashes in the JFR leak profiler. (Or maybe it has, and I didn't find the JBS issue(s).)
[1] Such a constructor "performs the set of initializations of the class that would be performed by a user-written default constructor ... with an empty mem-initializer-list and an empty function body." (C++03 12.1/7; updated wording but otherwise similar in C++14.)
[2] If a data member is not named by a mem-initializer-id (including the case where there is no mem-initializer-list) and is not of class type, it is not initialized. (C++03 12.6.2/4; C++14 says this case is default initialized, but that's equivalent to uninitialized for the member's type.)
- duplicates
-
JDK-8238592 JFR: Crash when dumping paths to gc roots on deep heaps
- Closed