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

Mutex name may point to garbage after JDK-8264146

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 17
    • hotspot
    • None

      While playing Kim's latest string deduplication code to enable string deduplication during root scan, I got following assertion:

      # assert(false) failed: Attempting to acquire lock ^H<98>¬l<8d>^?/9 out of order with lock stack_watermark_lock/2 -- possible deadlock

      The first lock name should be one of OopStorage's _allocation_mutex, but it showed as garbage above.

      It turns out that _allocation_mutex name is generated dynamically.

      e.g.
      _allocation_mutex(make_oopstorage_mutex(name, "alloc", Mutex::oopstorage)),

      and

      static Mutex* make_oopstorage_mutex(const char* storage_name,
                                          const char* kind,
                                          int rank) {
        char name[256];
        os::snprintf(name, sizeof(name), "%s %s lock", storage_name, kind);
        return new PaddedMutex(rank, name, true, Mutex::_safepoint_check_never);
      }

            Unassigned Unassigned
            zgu Zhengyu Gu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: