-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b08
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8325997 | 11.0.23 | Jonathan Dowland | P4 | Resolved | Fixed | b04 |
http://hg.openjdk.java.net/jdk/jdk/file/a5852eb26137/src/hotspot/share/oops/symbol.cpp#l53
Symbol::Symbol(const u1* name, int length, int refcount) {
_hash_and_refcount = pack_hash_and_refcount((short)os::random(), refcount);
_length = length;
_body[0] = 0; // in case length == 0 <<<<<< HERE
for (int i = 0; i < length; i++) {
byte_at_put(i, name[i]);
}
}
Per Kim Barrett:
The first two elements of _body are used by identity_hash().
That seems like a possible reason to force initialization of both
elements, which currently isn't done for length <= 1. But maybe it
doesn't matter that identity_hash isn't consistent between processes,
in which case forcing the initialization of _body[0] also shouldn't
be needed.
Symbol::Symbol(const u1* name, int length, int refcount) {
_hash_and_refcount = pack_hash_and_refcount((short)os::random(), refcount);
_length = length;
_body[0] = 0; // in case length == 0 <<<<<< HERE
for (int i = 0; i < length; i++) {
byte_at_put(i, name[i]);
}
}
Per Kim Barrett:
The first two elements of _body are used by identity_hash().
That seems like a possible reason to force initialization of both
elements, which currently isn't done for length <= 1. But maybe it
doesn't matter that identity_hash isn't consistent between processes,
in which case forcing the initialization of _body[0] also shouldn't
be needed.
- backported by
-
JDK-8325997 Always initialize _body[0..1] in Symbol constructor
- Resolved
- relates to
-
JDK-8247818 GCC 10 warning stringop-overflow with symbol code
- Resolved