JDK-8214444 : Wrong strncat limits in dfa.cpp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-28
  • Updated: 2020-04-28
  • Resolved: 2018-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11.0.8-oracleFixed 12 b23Fixed
Related Reports
Relates :  
Relates :  
Description
GCC 8 reports errors like:

src/hotspot/share/adlc/dfa.cpp:724:14: error: 'char* strncat(char*, const char*, size_t)' specified bound 2048 equals destination size [-Werror=stringop-overflow=] 
       strncat(string_buffer, "+", STRING_BUFFER_LENGTH); 

Both GCC 8 and static check tools can be satisfied by carefully switching from strncat to snprintf.
It would be nice to use jio_snprintf but adlc should not depend on VM.
Comments
Fix request (11u) -- will label after testing completed. I would like to downport this for parity with 11.0.8-oracle. Applies clean.
22-04-2020

http://cr.openjdk.java.net/~dchuyko/8214444/webrev.00/
30-11-2018

ILW = build error with gcc 8; in adlc source; use current default gcc version! = MLM = P4
29-11-2018