awecz · GitHub

Describe the bug
VisualVM fails to process instance of java.util.logging.LogRecord if has custom Level class instance (extending java.util.logging.Level) in level member. In our case we extended Level class to add more levels.

Root of the problem is in libs.profiler/profiler.heapwalker/src/org/graalvm/visualvm/lib/profiler/heapwalk/details/jdk/UtilDetailsProvider.java, class DetailsLogRecord, method getLevel(), where IllegalArgument exception is thrown in Level.parse().

To Reproduce
Steps to reproduce the behavior:

  1. Extend java.util.logging.Level class
  2. Create instanceof of java.util.logging.LogRecord using class from 1.
  3. Run code with instance of java.util.logging.LogRecord from 2. in memory
  4. Open running process in VisualVM
  5. Create a heapdump
  6. Go to objects, search for LogRecord and try opening the details

Expected behavior

VisualVM should not fail on processing such an object in DetailsLogRecord class, exception should be caught and this object should be shown just like any other object that has no special parsing of its content.

VisualVM log

messages-level.log

Screenshots

image

Desktop (please complete the following information):

  • Linux
  • OpenJDK 64-Bit Server VM 17.0.9+9; Eclipse Adoptium
  • 2.1.7

Additional context

Read the original on github.com ↗