RFR(xxs): 8145410: OutputStream::fill_to() does not work for error log

David Holmes david.holmes at oracle.com
Wed Dec 16 06:46:34 UTC 2015


Hi Thomas,

I'll need a second opinion on this one :)

On 16/12/2015 12:59 AM, Thomas Stüfe wrote:
> Hi all,
>
> please review and sponsor this tiny change.
>
> outputStream::fill_to() does not work as expected for the
> staticBufferStream because its position never gets updated. That means that
> fill_to() does not work in error reporting.

Okay I think I see what you are doing with the call to update_position, 
but shouldn't all staticBufferStream methods be delegating to the 
_outer_stream? I confess I'm unclear the roles of the buffer and the 
outer_stream in this abstraction.

Aside: Looking at these other uses of update_position:

void fileStream::write(const char* s, size_t len) {
   if (_file != NULL)  {
     // Make an unused local variable to avoid warning from gcc 4.x 
compiler.
     size_t count = fwrite(s, 1, len, _file);
   }
   update_position(s, len);
}

void fdStream::write(const char* s, size_t len) {
   if (_fd != -1) {
     // Make an unused local variable to avoid warning from gcc 4.x 
compiler.
     size_t count = ::write(_fd, s, (int)len);
   }
   update_position(s, len);
}

shouldn't they be inside the if statement ??

Cheers,
David
-----


> (I need this function because I am implementing an AIX-specific callstack
> dumper and with the broken fill_to the output looks quite ugly)
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8145410
> webrev:
> http://cr.openjdk.java.net/~stuefe/webrevs/8145410-fill_to-errorlog/webrev.00/webrev/
>
> Thanks!
>
> Thomas
>


More information about the hotspot-runtime-dev mailing list