Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8335536

Fix assertion failure in IdealGraphPrinter when append is true

XMLWordPrintable

    • b05

        When `IdealGraphPrinter` is created with `append` set to true, it does not write the head element to the file in its constructor. But in the destructor, it always writes the tail element to the file no matter `append` is true or not, which causes an assertion failure in `xmlStream::pop_tag`:

        # Internal Error (/root/jdk/src/hotspot/share/utilities/xmlstream.cpp:186), pid=1520448, tid=1520452
        # assert(_element_depth > 0) failed: must be in an element to close

        Stack: [0x00007ffff59fc000,0x00007ffff5afd000], sp=0x00007ffff5afbc70, free space=1023k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x197e9d3] xmlStream::pop_tag(char const*)+0x1c3 (xmlstream.cpp:186)
        V [libjvm.so+0x197f8c3] xmlStream::tail(char const*)+0x13 (xmlstream.cpp:317)
        V [libjvm.so+0xdce4ec] IdealGraphPrinter::~IdealGraphPrinter()+0x1c (idealGraphPrinter.cpp:218)
        V [libjvm.so+0xdce5ff] IdealGraphPrinter::clean_up()+0x9f (idealGraphPrinter.cpp:106)
        V [libjvm.so+0x17d03c7] Threads::destroy_vm()+0x267 (threads.cpp:949)
        V [libjvm.so+0xf7571c] jni_DestroyJavaVM+0x9c (jni.cpp:3733)
        C [libjli.so+0x455f] JavaMain+0x2bf (java.c:679)
        C [libjli.so+0x7cc9] ThreadJavaMain+0x9 (java_md.c:653)

        This issue can be reproduced by calling `igv_append` directly, or by calling `Compile::igv_print_method_to_file` with `append` set to true.

        This patch fixes the issue.

              qxing Qizheng Xing
              qxing Qizheng Xing
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: