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

Thomas Stüfe thomas.stuefe at gmail.com
Tue Aug 3 04:38:36 UTC 2021

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?

> David

More information about the hotspot-runtime-dev mailing list