Skip to content

VisualVM fails on parsing/showing object of LogRecord class if it uses an extended Level class #533

@awecz

Description

@awecz

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions