Bug in Utils.tryWith

Aleksandr Dubinsky adubinsky at almson.net
Sun May 24 14:40:31 UTC 2015


Hi,

I couldn't find an issue tracker so I am posting the bug report here.

Firstly, I must say, you are very brave to be using raw Runtime.exec! In
any case, there is a simple bug at line 340. `if (err > 0)` should be `if
(err != 0)`.

The bug is exhibited when WinPerfAsmProfiler is started without admin
rights and xperf returns -2147023892 and prints "xperf: error: NT Kernel
Logger: Invalid flags. (0x3ec)." This error is not caught. Instead, the
user is told "The perf event count is suspiciously low (0)."

I would also modify WinPerfAsmProfiler line 161 to say "Failed to start
xperf: " + errs + "\nEnsure that you are running this profiling session as
an administrator." or similar.

There is something hugely difficult in trying to get HSDIS for Windows,
with copyright nazis and other idiots getting in the way. It's good that
you link to the Oracle wiki, although it isn't very helpful. This
StackOverflow discussion (to which I've contributed the best I could) is
more helpful
http://stackoverflow.com/questions/1503479/how-to-see-jit-compiled-code-in-jvm/15146962#15146962
(and expands on the same solutions that are found in the comments to the
Oracle wiki). Might make sense linking here until the Oracle wiki improves,
you write a dedicated help page, or someone just publishes a windows binary
that works.

Lastly, I beg you to document all of the system properties referenced in
WinPerfAsmProfiler AND AbstractPerfAsmProfiler as a TABLE in the
WinPerfAsmProfiler javadoc comment.

Thank you for your great work,
Aleksandr Dubinsky


More information about the jmh-dev mailing list