-
Bug
-
Resolution: Fixed
-
P5
-
7
-
b03
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2176984 | 7 | Peter Kessler | P3 | Closed | Fixed | b17 |
JDK-2172466 | 6u10 | Peter Kessler | P3 | Closed | Fixed | b09 |
Subject: pscan warning fixlets
Date: Wed, 21 Mar 2007 15:48:22 +0100
From: Dalibor Topic <###@###.###>
To: ###@###.###
Inspired by cos's blog[0] from a while ago, I ran pscan[1] on the
hotspot code base to scan for simple formatting issues, and produced the
attached patch to introduce "%s" where it seemed appropriate.
I tried to convince the bug tracker to let me file this as an RFE for
making hotspot pscan clean, but I failed to find an openjdk category,
and the bug tracker told me that generic platforms are not supported, so
I'm posting this without a bug number.
After applying the patch, there is one remaining warning from pscan
about use of 'warn', but it's just the poor pscan tool getting confused
about assembler_sparc.cpp having a method called 'warn'. It may make
sense to rename it to, say, warning, if being 'pscan-clean' is of interest.
cheers,
dalibor topic
[0] http://weblogs.java.net/blog/cos/archive/2006/10/static_analyzer.html
[1] http://lwn.net/2000/0713/a/PScan.php3 , packaged for most
distributions, afaik. Running pscan on the hotspot code base is pretty easy:
dalibor@kaffe:~/$ find hotspot/ -name "*.c" | xargs pscan
hotspot/src/os/linux/launcher/java_md.c:676 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/linux/launcher/java_md.c:680 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/launcher/java_md.c:676 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/launcher/java_md.c:680 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c:45 SECURITY: printf call should have "%s" as argument 0
hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c:59 SECURITY: printf call should have "%s" as argument 0
dalibor@kaffe:~/$ find hotspot/ -name "*.cpp" | xargs pscan
hotspot/src/cpu/sparc/vm/assembler_sparc.cpp:1893 SECURITY: warn call should have "%s" as argument 0
hotspot/agent/src/share/native/jvmdi/sa.cpp:238 SECURITY: fprintf call should have "%s" as argument 1
so it may be useful to add a makefile target for it.
Date: Wed, 21 Mar 2007 15:48:22 +0100
From: Dalibor Topic <###@###.###>
To: ###@###.###
Inspired by cos's blog[0] from a while ago, I ran pscan[1] on the
hotspot code base to scan for simple formatting issues, and produced the
attached patch to introduce "%s" where it seemed appropriate.
I tried to convince the bug tracker to let me file this as an RFE for
making hotspot pscan clean, but I failed to find an openjdk category,
and the bug tracker told me that generic platforms are not supported, so
I'm posting this without a bug number.
After applying the patch, there is one remaining warning from pscan
about use of 'warn', but it's just the poor pscan tool getting confused
about assembler_sparc.cpp having a method called 'warn'. It may make
sense to rename it to, say, warning, if being 'pscan-clean' is of interest.
cheers,
dalibor topic
[0] http://weblogs.java.net/blog/cos/archive/2006/10/static_analyzer.html
[1] http://lwn.net/2000/0713/a/PScan.php3 , packaged for most
distributions, afaik. Running pscan on the hotspot code base is pretty easy:
dalibor@kaffe:~/$ find hotspot/ -name "*.c" | xargs pscan
hotspot/src/os/linux/launcher/java_md.c:676 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/linux/launcher/java_md.c:680 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/launcher/java_md.c:676 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/launcher/java_md.c:680 SECURITY: snprintf call should have "%s" as argument 2
hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c:45 SECURITY: printf call should have "%s" as argument 0
hotspot/src/os/solaris/dtrace/generateJvmOffsetsMain.c:59 SECURITY: printf call should have "%s" as argument 0
dalibor@kaffe:~/$ find hotspot/ -name "*.cpp" | xargs pscan
hotspot/src/cpu/sparc/vm/assembler_sparc.cpp:1893 SECURITY: warn call should have "%s" as argument 0
hotspot/agent/src/share/native/jvmdi/sa.cpp:238 SECURITY: fprintf call should have "%s" as argument 1
so it may be useful to add a makefile target for it.
- backported by
-
JDK-2172466 Make HotSpot pscan clean
- Closed
-
JDK-2176984 Make HotSpot pscan clean
- Closed
- relates to
-
JDK-6538428 JDK native code should be pscan clean
- Closed