RFR: 8272094: compiler/codecache/TestStressCodeBuffers.java crashes with "failed to allocate space for trampoline"

Andrew Haley aph at openjdk.java.net
Mon May 16 16:58:34 UTC 2022


On Mon, 16 May 2022 16:01:46 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Okay, so what is supposed to happen on failure? I see `aarch64.ad` has two rules that use `__ zero_words`.
> 
> `clearArray_reg_reg` does:
> 
> ```
>     address tpc = __ zero_words($base$$Register, $cnt$$Register);
>     if (tpc == NULL) {
>       ciEnv::current()->record_failure("CodeCache is full");
>       return;
>     }
> ```
> 
> ...while `clearArray_imm_reg` calls through to `MacroAssembler::zero_words(Register base, uint64_t cnt)`, which still enters this method without checking the result? Maybe the predicate saves us here, IDK.

Good catch. Yes, it is saved by the predicate, which is `cnt < (BlockZeroingLowLimit >> LogBytesPerWord)`. The macro checks for `cnt <= (uint64_t)BlockZeroingLowLimit / BytesPerWord`, and in that case generates a short inline sequence. It's pretty evil code, though. (Can we say "pathological coupling"?. I think I'll add a check, although it will be unreachable in the current source because of the predicate.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8730


More information about the hotspot-dev mailing list