[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8207025: JvmtiEnv::SetSystemProperty() does not handle OOM
From:       Ioi Lam <iklam () openjdk ! java ! net>
Date:       2022-03-29 21:24:48
Message-ID: Eo4uQL2Bv0BgtrhTYLmJEkwpFjmPN4fdRCR8YAWkF7g=.dca98f8d-45cc-405d-9fb0-bbdc993a5c90 () github ! com
[Download RAW message or body]

On Mon, 28 Mar 2022 04:14:32 GMT, Ioi Lam <iklam@openjdk.org> wrote:

> `JvmtiEnv::SetSystemProperty` eventually calls `PathString::set_value` in \
> arguments.cpp, which aborts the VM when it fails to allocate a string copy of the \
> property value. 
> 
> bool PathString::set_value(const char *value) {
> if (_value != NULL) {
> FreeHeap(_value);
> }
> _value = AllocateHeap(strlen(value)+1, mtArguments   );
> // should pass AllocFailStrategy::RETURN_NULL -----^
> assert(_value != NULL, "Unable to allocate space for new path value");
> 
> 
> This should be fixed so that `JvmtiEnv::SetSystemProperty` can return \
> `JVMTI_ERROR_OUT_OF_MEMORY` in case of OOM. See \
> https://docs.oracle.com/en/java/javase/17/docs/specs/jvmti.html#SetSystemProperty

This pull request has now been integrated.

Changeset: 8cdabea0
Author:    Ioi Lam <iklam@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/8cdabea0abdc702242a3fb4b0538980ab8f6a9d6
                
Stats:     41 lines in 4 files changed: 17 ins; 9 del; 15 mod

8207025: JvmtiEnv::SetSystemProperty() does not handle OOM

Reviewed-by: dholmes, sspitsyn

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic