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

Early crashes in os::print_context on AArch64

XMLWordPrintable

    • b24

        In our error reporting we have two sections that print the registers:
        ```
          STEP("printing register info")

             // decode register contents if possible
             if (_verbose && _context && _thread && Universe::is_fully_initialized()) {
               ResourceMark rm(_thread);
               os::print_register_info(st, _context);
               st->cr();
             }

          STEP("printing registers, top of stack, instructions near pc")

             // registers, top of stack, instructions near pc
             if (_verbose && _context) {
               os::print_context(st, _context);
               st->cr();
             }
        ```
        On Linux x64 we perform the risky print_location calls inside the first section, so if that crash it only skips the rest of the registers. The plain value printing is done in the second section. However, on Linux x64, this has been swapped, so if we crash in the second section, it skips printing the instruction hex dump and pc context.

        This is unfortunate, since we often crash in the register printing.

        One way to fix this would be to mimic the x64 printing. Another, which I think would be nicer, would be to split this into three sections:
        1) Print the register values (Like Linux AArch64 does)
        2) Print the decoded register values using the risky print_location
        3) Print the rest of the context

        Alternatively, fuse the proposed (1) and (2), and make it so that the safe printing of all registers comes before the unsafe printing.

              gziemski Gerard Ziemski
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: