Amalloc may return null despite contrary AllocFailType

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Not an Issue
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: 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.

            Assignee:
            Afshin Zafari
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: