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

hs_err improvement: Get register information when we assert not only when we crash.

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 7-pool, 8
    • Fix Version/s: 9
    • Component/s: hotspot

      Description

      We should make sure we read the OS-context when hitting asserts in debug-builds. Today we only get registers, code and stack on actual crashes. Very valuable info that is missing when investigating many test failures.

      There was concerns on the mailing list that for a crash (i.e. because of a SIGSEGV) the kernel saves the context for the PC which caused the problem. 'assert' and 'guarantee' are macros which evaluate an expression and call report_vm_error if that expression was 'false'. One could call 'getcontext()' after the evaluation of the expression, but that's not actually the context where the evaluation of the expression failed.

      An alternative suggested by Nils is to force a crash and let the crash handler do the works as usual. It has been done and worked pretty well. We should just make sure that -XX:SuppressErrorAt and similar flags are respected. We currently only check if we should ignore an assertion in report_vm_error(). If we would crash before (i.e. right after the evaluation of the expression), -XX:SuppressErrorAt would be useless.

      On the other side, if we only crash in report_vm_error(), we would get the context in that functions which would not contain the desired register values in the frame which crashed either. So we'd probably have to think how this could be implemented in the best way.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mcastegr Mattis Castegren (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: