RFR: 8271003: hs_err improvement: handle CLASSPATH env setting longer than O_BUFLEN

David Holmes david.holmes at oracle.com
Tue Aug 3 05:32:10 UTC 2021

On 3/08/2021 2:38 pm, Thomas Stüfe wrote:
> Hi David,
>      >
>      > The problem is that the print_cr() functions are supposed to
>     write the newline *with the same `write(2)` call*. That is not
>     documented in do_vsnprintf(), but maybe we should do that since its
>     an easy to miss a detail.
>      >
>      > Writing with one single `write(2)` call guarantees some atomicity
>     when writing concurrently from several threads. If you write the
>     newline separately, you risk line tear - the newline appearing away
>     from its line.
>     Do we really rely on the write(2) call for atomicity? The defaultStream
>     uses a lock and we could pass `add_cr` through to defaultStream::write
>     so that the cr is added under the lock.
> That would only work for the defaultStream, no? What about other streams?

Do the other streams have atomicity in the first place? It's not an 
issue for stringStream as they aren't shared.


>     Cheers,
>     David
> ..Thomas

More information about the hotspot-runtime-dev mailing list