JDK-8026300 : VM warning: increase O_BUFLEN in ostream.hpp -- output truncated occurs with fastdebug VM when printing flags
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs25
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-11
  • Updated: 2014-11-12
  • Resolved: 2013-12-16
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 7 JDK 8 JDK 9
7u80Resolved 8u20Fixed 9 b02Fixed
Related Reports
Duplicate :  
Relates :  
Description
As of jdk8-b111 (hs25-b53) we have a regression trying to print the final flags values:

 /java/re/jdk/8/promoted/all/b111/binaries/linux-i586/fastdebug/bin/java -XX:+PrintFlagsFinal -version 2>&1 | more
[Global flags]
    ccstr AbortVMOnException                        =                 Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{notproduct}
    ccstr AbortVMOnExceptionMessage                 =                 Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{notproduct}
    uintx AdaptiveSizeDecrementScaleFactor          = 4               Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{product}
    uintx AdaptiveSizeMajorGCDecayTimeScale         = 10              Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{product}
    uintx AdaptiveSizePausePolicy                   = 0               Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{product}
    uintx AdaptiveSizePolicyCollectionCostMargin    = 50              Java HotSpot(TM) Server VM warning: increase O_BUFLEN
in ostream.hpp -- output truncated
{product}

Somehow we get a ostream buffer overflow printing each flag - though the buffer should be 2000 characters and so of ample size.

Only affects fastdebug.
Comments
Can we please backport this everywhere it applies.
03-04-2014

A simple fix when repo is reopen: diff --git a/src/share/vm/runtime/globals.cpp b/src/share/vm/runtime/globals.cpp --- a/src/share/vm/runtime/globals.cpp +++ b/src/share/vm/runtime/globals.cpp @@ -295,7 +295,7 @@ else st->print("%-16s", ""); } - st->print("%-20"); + st->print("%-20s", " "); print_kind(st); if (withComments) {
02-12-2013

ILW LHM = P4 I: Low, Warnings when printing flags L: High, Happens every time with -XX:+PrintFlagsFinal when running on debug builds W: Medium, Don't use this flag on debug builds
11-10-2013