RFR(trivial): 8231024: Improve the debug info when the output is truncated

David Holmes david.holmes at oracle.com
Sun Sep 15 02:03:23 UTC 2019


Hi Jie,

On 14/09/2019 7:00 pm, Jie Fu wrote:
> Hi all,
> 
> JBS:    https://bugs.openjdk.java.net/browse/JDK-8231024
> Webrev: http://cr.openjdk.java.net/~jiefu/8231024/webrev.00/
> 
> *Background*
> When I was running a jtreg test with
> ------------------------------------
> make test 
> TEST="test/jdk/java/lang/invoke/TestCatchExceptionWithVarargs.java" 
> CONF=fast
> ------------------------------------
> I got some VM warnings which just told me to increase O_BUFLEN in 
> ostream.hpp.
> But the debug info didn't tell us the proper value of O_BUFLEN needed by 
> the output.
> 
> It might be better to dump the required value of O_BUFLEN.
> 
> *Fix*
> 
> - Before the patch
> ------------------------------------
> [2019-09-14 16:07:55,752] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp -- output truncated
> [2019-09-14 16:07:55,758] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp -- output truncated
> [2019-09-14 16:07:55,763] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp -- output truncated
> ...
> ------------------------------------
> 
> - After the patch
> ------------------------------------
> [2019-09-14 16:19:09,478] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp: at least 2013 is required -- 
> output truncated
> [2019-09-14 16:19:09,482] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp: at least 2031 is required -- 
> output truncated
> [2019-09-14 16:19:09,488] Agent[1]: stderr: OpenJDK 64-Bit Server VM 
> warning: increase O_BUFLEN in ostream.hpp: at least 2049 is required -- 
> output truncated
> ------------------------------------
> 
> Could you please review it?

Looks good. But given this keeps reporting different values, the input 
buffer size must be different in each case, so printing that size as 
well could also be useful for tracing back to the callsite. There seems 
to be as assumption that the buffer is always O_BUFLEN in size but as it 
is set to 2000 that can't be the case. In which case the error message 
itself seems somewhat misleading.

Thanks,
David

> Thanks a lot.
> Best regards,
> Jie
> 
> 


More information about the hotspot-dev mailing list