[jdk11u-dev] RFR: 8051959: Add thread and timestamp options to java.security.debug system property

Antonio Vieiro duke at openjdk.org
Mon Feb 17 16:34:40 UTC 2025


Almost clean backport of [JDK-8051959](https://bugs.openjdk.org/browse/JDK-8051959) that adds options to `java.security.debug` to enhance traces with thread, log record and timestamp information, improving traceability and easying troubleshooting, on par with ["The java.security.debug System Property"  in JDK17](https://docs.oracle.com/en/java/javase/17/security/troubleshooting-security.html#GUID-05F3E865-20FF-46EB-AC35-84D4B552CA48) and above, and with 11.0.26-oracle. Low risk.

Backport is not completely clean because, among other things, [JDK-8292177](https://bugs.openjdk.org/browse/JDK-8292177) was applied differently in 11 (also `HexFormat` is not in 11).

One of the tests cases had to be changed, since JDK11 does not keep track of [Security#initialSystemProperties](https://github.com/openjdk/jdk17u-dev/blob/fcdcff0e0d6a25de5e1c3bd62ba909774663b0db/src/java.base/share/classes/java/security/Security.java#L68)  and thus searching for [`properties: Initial`](https://github.com/openjdk/jdk17u-dev/blob/fcdcff0e0d6a25de5e1c3bd62ba909774663b0db/test/jdk/sun/security/util/Debug/DebugOptions.java#L50) in the test `stderr` makes no sense. We're searching for `properties: java.security` instead (this is indicated in the github PR).

Tested on Linux with tier1...


==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg:tier1                     1497  1497     0     0   
   jtreg:test/jdk:tier1                               1899  1899     0     0   
   jtreg:test/langtools:tier1                         3941  3941     0     0   
   jtreg:test/nashorn:tier1                              0     0     0     0   
   jtreg:test/jaxp:tier1                                 0     0     0     0   
==============================
TEST SUCCESS


... and security tests ...

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/jdk/sun/security                         658   658     0     0   
==============================
TEST SUCCESS

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

Commit messages:
 - Backport f277b3999f8cd30d5874ce58f290a06538d0189f

Changes: https://git.openjdk.org/jdk11u-dev/pull/2998/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk11u-dev&pr=2998&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8051959
  Stats: 244 lines in 2 files changed: 224 ins; 7 del; 13 mod
  Patch: https://git.openjdk.org/jdk11u-dev/pull/2998.diff
  Fetch: git fetch https://git.openjdk.org/jdk11u-dev.git pull/2998/head:pull/2998

PR: https://git.openjdk.org/jdk11u-dev/pull/2998


More information about the jdk-updates-dev mailing list