From mbaesken at openjdk.org Mon Sep 1 06:51:51 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Mon, 1 Sep 2025 06:51:51 GMT Subject: jmx-dev RFR: 8366092: [GCC static analyzer] UnixOperatingSystem.c warning: use of uninitialized value 'systemTicks' [v3] In-Reply-To: References: Message-ID: On Fri, 29 Aug 2025 14:11:01 GMT, Matthias Baesken wrote: >> When using gcc static analyzer (-fanalyzer) with gcc 13.2 the following issue is reported : >> >> /jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c: In function 'get_jvmticks': >> /jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c:208:24: warning: use of uninitialized value 'systemTicks' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] >> 208 | pticks->usedKernel = systemTicks; >> >> >> vsscanf usually/normally reads the systemTicks info from /proc file system. see >> https://github.com/openjdk/jdk/blob/45726a1f8b8f76586037867a32b82f8ab9b96937/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c#L163 >> but we never check that the *exact* number of params is read with vsscanf : >> n = vsscanf(tmp, fmt, args); >> So potentially we could get a non complete info without systemTicks and the call would still succeed. > > Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision: > > Avoid initialization Thanks for the reviews ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/26962#issuecomment-3241061930 From mbaesken at openjdk.org Mon Sep 1 06:51:52 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Mon, 1 Sep 2025 06:51:52 GMT Subject: jmx-dev Integrated: 8366092: [GCC static analyzer] UnixOperatingSystem.c warning: use of uninitialized value 'systemTicks' In-Reply-To: References: Message-ID: On Wed, 27 Aug 2025 14:23:35 GMT, Matthias Baesken wrote: > When using gcc static analyzer (-fanalyzer) with gcc 13.2 the following issue is reported : > > /jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c: In function 'get_jvmticks': > /jdk/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c:208:24: warning: use of uninitialized value 'systemTicks' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] > 208 | pticks->usedKernel = systemTicks; > > > vsscanf usually/normally reads the systemTicks info from /proc file system. see > https://github.com/openjdk/jdk/blob/45726a1f8b8f76586037867a32b82f8ab9b96937/src/jdk.management/linux/native/libmanagement_ext/UnixOperatingSystem.c#L163 > but we never check that the *exact* number of params is read with vsscanf : > n = vsscanf(tmp, fmt, args); > So potentially we could get a non complete info without systemTicks and the call would still succeed. This pull request has now been integrated. Changeset: a6e2a329 Author: Matthias Baesken URL: https://git.openjdk.org/jdk/commit/a6e2a329a07c71582ac696809fb5349c6a0b681c Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8366092: [GCC static analyzer] UnixOperatingSystem.c warning: use of uninitialized value 'systemTicks' Reviewed-by: kevinw, asteiner ------------- PR: https://git.openjdk.org/jdk/pull/26962 From sroy at openjdk.org Mon Sep 8 08:19:13 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Mon, 8 Sep 2025 08:19:13 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: References: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> Message-ID: On Thu, 7 Aug 2025 05:36:46 GMT, Thomas Stuefe wrote: > > Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: > > Who? me? Other Reviewers? Strange PR description ;-) I edited the comment here...will edit in the bugs too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25332#issuecomment-3265117328 From sroy at openjdk.org Wed Sep 10 08:06:07 2025 From: sroy at openjdk.org (Suchismith Roy) Date: Wed, 10 Sep 2025 08:06:07 GMT Subject: jmx-dev RFR: JDK-8030957 - AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and .getProcessCpuLoad() on AIX [v4] In-Reply-To: References: <_h4TBkuFudR5wTGue1oEaeqlZcPZfPnJcWmFdWboZfM=.5676751b-ad3b-4b37-9822-b17464c093dc@github.com> Message-ID: <-sscVFQjjrzV4-iWqG2DIl4m7sEHC3LEB3EUQ829zQk=.0b50fc02-bf1e-4296-843d-a5cbdbf51f9b@github.com> On Thu, 7 Aug 2025 05:36:46 GMT, Thomas Stuefe wrote: >> Suchismith Roy has updated the pull request incrementally with one additional commit since the last revision: >> >> Update ProblemList.txt > >> Once this issue has been resolved you should not forget to remove the two excludes from jdk/test/ProblemList.txt: >> > > Who? me? Other Reviewers? Strange PR description ;-) Hi @tstuefe Could you kindly review the patch with suggested changes ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25332#issuecomment-3273798917