RFR [XS] : 8239224: libproc_impl.c previous_thr may be used uninitialized warning

Baesken, Matthias matthias.baesken at sap.com
Mon Feb 17 13:10:15 UTC 2020


Hello, please review this small fix.

When building a product build  with gcc7 on linux x86_64, and trying out different optimization options, I run into this error when
optimizing for space (-Os)  :


/open_jdk/jdk_5/jdk/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c: In function 'delete_thread_info':
/open_jdk/jdk_5/jdk/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c:285:26: error: 'previous_thr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       previous_thr->next = current_thr->next;
       ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

We should probably better initialize previous_thr to avoid this warning.

(it does not show up however with the default optimization options ).


Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8239224

http://cr.openjdk.java.net/~mbaesken/webrevs/8239224.0/


Thanks, Matthias


More information about the hotspot-dev mailing list