RFR: 8266773: Release VM is broken with GCC 9 after 8214237

Marcus G K Williams mgkwill at openjdk.java.net
Mon May 10 22:35:30 UTC 2021


On Mon, 10 May 2021 02:39:38 GMT, Jie Fu <jiefu at openjdk.org> wrote:

> Hi all,
> 
> Release VM is broken with GCC 9 due to -Werror=format-overflow=.
> And if this assert[1] is removed, fastdebug VM can also reproduce the same bug.
> The key to reproduce it is to compile with -O3.
> 
> IMO, it seems like a false positive gcc bug.
> But we'd better fix it since gcc 9 is assumed to be supported to build OpenJDK.
> 
> Thanks.
> Best regards,
> Jie
> 
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp#L47

FYI: this patch appears to solve the build issue for me:

diff --git a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
index 2e52bd9dcc6..846511ae521 100644
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp
@@ -319,7 +319,9 @@ void G1GCPhaseTimes::details(T* phase, const char* indent_str) const {
   LogTarget(Trace, gc, phases, task) lt;
   if (lt.is_enabled()) {
     LogStream ls(lt);
-    ls.print("%s", indent_str);
+    if (indent_str) {
+      ls.print("%s", indent_str);
+    }
     phase->print_details_on(&ls);
   }
 }
@@ -332,7 +334,7 @@ void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent_level
   for (uint i = 0; i < phase->MaxThreadWorkItems; i++) {
     WorkerDataArray<size_t>* work_items = phase->thread_work_items(i);
     if (work_items != NULL) {
-      out->print("%s", indent(indent_level + 1));
+      out->sp(indent_level * 2);
       work_items->print_summary_on(out, true);
       details(work_items, indent(indent_level + 1));
     }


Not sure if this is the correct solution.

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

PR: https://git.openjdk.java.net/jdk/pull/3941



More information about the hotspot-gc-dev mailing list