Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-6681

JMC parser can't handle char fields

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: docs
    • Labels:
      None

      Description

      Reproducer:

      =========================================
      import jdk.jfr.Event;

      public class Repro {

      static class MessageEvent extends Event

      { char message; }

      public static void main(String... args)

      { MessageEvent m1 = new MessageEvent(); m1.message = '?'; m1.commit(); MessageEvent m2 = new MessageEvent(); m2.message = '!'; m2.commit(); MessageEvent m3 = new MessageEvent(); m3.message = '.'; m3.commit(); }

      }
      =========================================

      $ java -XX:StartFlightRecording:settings=none,filename=file.jfr Repro.java
      $ jmc -open file.jfr

      'Loding events from file file.jfr' has encountered problems

      org.openjdk.jmc.flightrecorder.internal.InvalidJfrFileException: Unknown integer type: char
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.ValueReaders$PrimitiveReader.readLong(ValueReaders.java:419)
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.ValueReaders$QuantityReader.read(ValueReaders.java:187)
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.TypeManager$EventTypeEntry.readEvent(TypeManager.java:316)
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.TypeManager.readEvent(TypeManager.java:406)
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.ChunkLoaderV1.call(ChunkLoaderV1.java:88)
      at org.openjdk.jmc.flightrecorder.internal.parser.v1.ChunkLoaderV1.call(ChunkLoaderV1.java:47)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:830)

      Reference parser:

      $ jfr print file.jfr

      Repro$MessageEvent

      { startTime = 22:19:38.272 message = ? eventThread = "main" (javaThreadId = 1) stackTrace = [ Repro.main(String[]) line: 12 jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62 jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43 java.lang.reflect.Method.invoke(Object, Object[]) line: 567 ... ] }

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: