Output debug with printf?

Rachel Protacio rachel.protacio at oracle.com
Mon Jan 11 18:38:35 UTC 2016


I can't speak to your bugs, but at least one of the purposes of the 
outputStream*->print_cr() calls are that you can tty->print() multiple 
times, buffering the output, until a tty->cr() (or print_cr()) is 
called, which flushes the buffer.


On 1/8/2016 11:50 PM, Khanh Nguyen wrote:
> Hi everyone,
> I am modifying OpenJDK7 to implement an algorithm. In the process of doing
> this, I need to output debug information to the stdout. As I can see in the
> code base, all printings are done by using outputStream*->print_cr(). I
> wonder why printf() was not used at all?
> The reason I'm asking this because I in fact used a lot of printf() calls.
> And I have been seeing weird bugs such as random memory corruption and
> random JVM crashing. Is there any chance that my printf() is the root
> cause? (Assume that the logic is my code is bug-free of course)
> Thank you,
> Khanh Nguyen

More information about the hotspot-dev mailing list