-
Sub-task
-
Resolution: Fixed
-
P2
-
24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8350319 | 24.0.2 | Jaikiran Pai | P2 | Resolved | Fixed | master |
JDK-8350340 | 24.0.1 | Nibedita Jena | P2 | Resolved | Fixed | b07 |
JDK-8349414 | 24 | Jaikiran Pai | P2 | Resolved | Fixed | b36 |
"I have concerns with the changes here, because of what it can cause when an (incorrect) program is sharing a StringBuilder between multiple threads.
Even without any reordering, a thread could start an append(boolean|null), pass the ensureCapacityInternal call, then another thread up the count by enough to no longer have enough capacity. Then the first thread could proceed to read the new (no longer enough!) count, and write without any bounds checks outside of the array. Easy to reproduce with a debugger and some breakpoints."
Java ensures that a program will not perform out-of-bound accesses except when Unsafe is explicitly used by the user. Incorrect synchronization on StringBuilder should only result in the StringBuilder instance being corrupted, while out-of-bound accesses risk taking down the VM or corrupting the memory of other objects in the heap.
- backported by
-
JDK-8349414 [BACKOUT] Optimization for StringBuilder append boolean & null
-
- Resolved
-
-
JDK-8350319 [BACKOUT] Optimization for StringBuilder append boolean & null
-
- Resolved
-
-
JDK-8350340 [BACKOUT] Optimization for StringBuilder append boolean & null
-
- Resolved
-
- caused by
-
JDK-8333893 Optimization for StringBuilder append boolean & null
-
- Closed
-
- relates to
-
JDK-8349239 [BACKOUT] Reuse StringLatin1::putCharsAt and StringUTF16::putCharsAt
-
- Resolved
-
- links to
-
Commit(jdk24) openjdk/jdk/f0837b21
-
Commit(master) openjdk/jdk/618c5eb2
-
Review(jdk24) openjdk/jdk/23425
-
Review(master) openjdk/jdk/23420