RFR: 8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string [v3]

David Holmes dholmes at openjdk.org
Mon Jul 29 22:02:10 UTC 2024


> Exceptions::fthrow uses a 1024 byte buffer to format the incoming exception message string, but this may not be large enough, leading to truncation. However, we should ensure we truncate to a valid UTF8 sequence.
> 
> The process is explained in the code. Thanks to @RogerRiggs and @djelinski for their suggestions on how to tackle this.
> 
> Testing:
>  - new gtest exercises the truncation code with the different possibilities for bad truncation
>  - tiers 1-3 sanity testing
> 
> Thanks.

David Holmes has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Merge branch 'master' into 8325002-fthrow
 - Fix logic for 4th byte of 6.
 - Fix logic error and typo
 - Ensure the buffer is > 5 bytes
 - Fixed typo
 - 8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/20345/files
  - new: https://git.openjdk.org/jdk/pull/20345/files/02d636a6..794da826

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20345&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20345&range=01-02

  Stats: 13051 lines in 379 files changed: 7576 ins; 4001 del; 1474 mod
  Patch: https://git.openjdk.org/jdk/pull/20345.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20345/head:pull/20345

PR: https://git.openjdk.org/jdk/pull/20345


More information about the hotspot-dev mailing list