-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
25, 26
-
None
-
generic
-
linux
This can be used to identify e.g. some leaks like memory leaks, double close, use of uninitialized data etc. .
Some info about it :
https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html
https://developers.redhat.com/articles/2023/05/31/improvements-static-analysis-gcc-13-compiler
We can set this flag (-fanalyzer) for C compilation units (--with-extra-cflags=-fanalyzer ).
but this has still a few issues :
- the -fanalyzer flag goes also into the test C coding, not sure if this makes much sense
Example :
/jdk/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h:46:6: error: dereference of NULL '0' [CWE-476] [-Werror=analyzer-null-dereference]
- we fail rather early in the build because of the found analyzer issues, to see all findings we have to disable warnings as errors; should we maybe have ***one*** configure flag doing both ?
- some analyzer warnings like analyzer-fd-leak or analyzer-null-dereference (see libTestDwarfHelper.h:46) might be intended coding or a bit misleading, so we might need to disable some warnings
- relates to
-
JDK-8361873 [GCC static analyzer] exec_md.c forkedChildProcess potential double 'close' of file descriptor '3'
-
- Open
-
-
JDK-8361868 [GCC static analyzer] complains about missing calloc - NULL checks in p11_util.c
-
- Resolved
-
-
JDK-8361888 [GCC static analyzer] ProcessImpl_md.c Java_java_lang_ProcessImpl_forkAndExec error: use of uninitialized value '*(ChildStuff *)p.mode
-
- Resolved
-
-
JDK-8361959 [GCC static analyzer] java_props_md.c leak of 'temp' variable is reported
-
- Resolved
-
-
JDK-8361871 [GCC static analyzer] complains about use of uninitialized value ckpObject in p11_util.c
-
- New
-
-
JDK-8361955 [GCC static analyzer] libjdwp/threadControl.c threadControl_setPendingInterrupt error: dereference of NULL 'node'
-
- New
-
-
JDK-8362611 [GCC static analyzer] memory leak in ps_core.c core_handle_note
-
- New
-