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

Amalloc may return null despite contrary AllocFailType

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • hotspot

      `Arena::Amalloc` takes an `AllocFailType`.

      `Amalloc` calls `Arena::grow` if there isn't sufficient space available in the already allocated chunk to satisfy the request, and passes the failure mode to `grow`.

      `grow` calls `MemTracker::check_exceeds_limit`. If that call returns true, then `grow` returns nullptr, regardless of the requested failure mode.

      Callers of `Amalloc` that pass `EXIT_OOM` as the failure mode are typically not prepared for a null allocation result, and at least some will crash.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: