Projects
openEuler:24.03:SP1:Everything
openjdk-1.8.0
_service:tar_scm:fix-GCC-12-build-jdk8-fastdebu...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:fix-GCC-12-build-jdk8-fastdebug-error.patch of Package openjdk-1.8.0
Subject: Fix GCC 12 build jdk8 fastdebug error --- .../vm/gc_implementation/g1/concurrentMark.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index df901a52d..1347a7e16 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -2914,13 +2914,23 @@ void ConcurrentMark::print_reachable(const char* str, return; } - char file_name[JVM_MAXPATHLEN]; + // fix gcc 12 build jdk8 fastdebug compiler error: + // directive writing up to 4096 bytes into a region of size between 0 and 4096 [-Werror=format-overflow=] + // about old code: + // char file_name[JVM_MAXPATHLEN]; + // Leave L 2911~2915 code unchanged, so not affect original logic. + char *file_name = (char *) NEW_C_HEAP_ARRAY(char, strlen(G1PrintReachableBaseFile) + 2 + strlen(str), mtGC); + if (NULL == file_name) { + gclog_or_tty->print_cr(" #### error: NEW_C_HEAP_ARRAY failed."); + return; + } sprintf(file_name, "%s.%s", G1PrintReachableBaseFile, str); gclog_or_tty->print_cr(" dumping to file %s", file_name); fileStream fout(file_name); if (!fout.is_open()) { gclog_or_tty->print_cr(" #### error: could not open file"); + FREE_C_HEAP_ARRAY(char, file_name, mtGC); return; } @@ -2936,6 +2946,7 @@ void ConcurrentMark::print_reachable(const char* str, gclog_or_tty->print_cr(" done"); gclog_or_tty->flush(); + FREE_C_HEAP_ARRAY(char, file_name, mtGC); } #endif // PRODUCT -- 2.22.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2