RFR: 8220555: JFR tool shows incorrect message when it cannot access the file

Yasumasa Suenaga yasuenag at gmail.com
Thu Mar 14 02:34:17 UTC 2019


Hi Erik,

Thank you for your review.
I will push it when I get another reviewer(s).

I added the message to JBS in case of the user lacks permission.

$ ls -l /tmp/hs_err_pid4390.jfr
--w------- 1 yasuenag yasuenag 407637 Mar 14 11:25 /tmp/hs_err_pid4390.jfr
$ jfr print /tmp/hs_err_pid4390.jfr
jfr print: could not open file /tmp/hs_err_pid4390.jfr (Permission denied)


Yasumasa

2019年3月14日(木) 3:07 Erik Gahlin <erik.gahlin at oracle.com>:
>
> Looks good.
>
> According to the bug report, the following error message will printed if the file can’t be found.
>
> $ jfr print hs_err_pid4390.jfr
> jfr print: could not open file /home/ysuenaga/OpenJDK/jdk/hs_err_pid4390.jfr (No such file or directory)
>
> Which is reasonable.
>
> Could you also describe what the the error message will be, if the the user lacks permission to access the file.
>
> Thanks
> Erik
>
>
> > On 13 Mar 2019, at 08:46, Yasumasa Suenaga <yasuenag at gmail.com> wrote:
> >
> > Hi all,
> >
> > Please review this change:
> >
> >  JBS: https://bugs.openjdk.java.net/browse/JDK-8220555
> >  webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8220555/webrev.00/
> >
> > JFR tool shows error message as "could not find file" when it receives
> > FileNotFoundException from ctor of RandomAccessFile.
> > According to Javadoc of RandomAccessFile [1], FileNotFoundException
> > will be thrown when we do not be granted to access the file.
> > Therefore, the error message misleads the user.
> >
> > All tests on submit repo seems to be succeeded
> > (mach5-one-ysuenaga-JDK-8220555-20190313-0612-1175783).
> > Also it passed :jdk_jfr jtreg tests on my Linux box.
> >
> >
> > Thanks,
> >
> > Yasumasa
> >
> >
> > [1] https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/RandomAccessFile.html#%3Cinit%3E(java.io.File,java.lang.String)
>


More information about the hotspot-jfr-dev mailing list