-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
7, 8
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8019016 | 7u45 | John Rose | P3 | Closed | Fixed | b01 |
JDK-2222646 | 7u40 | John Rose | P3 | Closed | Fixed | b01 |
The following test program crashes the VM.
----
import java.lang.invoke.*;
import java.lang.reflect.*;
public class Test {
public Test obj;
public String str;
public static void main(String[] args) throws Throwable {
MethodHandles.Lookup l = MethodHandles.publicLookup();
Field field = Test.class.getField("str");
MethodHandle mh = l.unreflectSetter(field);
MethodHandle filter = l.unreflectGetter(Test.class.getField("obj"));
mh = MethodHandles.filterArguments(mh, 0, filter);
mh.invokeExact(new Test(), "hello");
}
}
---
The test crashes with the problematic frame "Unsafe_setObject". Without the filterArguments, if 'null' is directly passed to invokeExact as first argument, then we get WrongTypeException because null is inferred as Void type. But, when filterArguments and the filter returns null value, then the VM crashes.
----
import java.lang.invoke.*;
import java.lang.reflect.*;
public class Test {
public Test obj;
public String str;
public static void main(String[] args) throws Throwable {
MethodHandles.Lookup l = MethodHandles.publicLookup();
Field field = Test.class.getField("str");
MethodHandle mh = l.unreflectSetter(field);
MethodHandle filter = l.unreflectGetter(Test.class.getField("obj"));
mh = MethodHandles.filterArguments(mh, 0, filter);
mh.invokeExact(new Test(), "hello");
}
}
---
The test crashes with the problematic frame "Unsafe_setObject". Without the filterArguments, if 'null' is directly passed to invokeExact as first argument, then we get WrongTypeException because null is inferred as Void type. But, when filterArguments and the filter returns null value, then the VM crashes.
- backported by
-
JDK-2222646 VM crash with a field setter method with a filterArguments
- Closed
-
JDK-8019016 VM crash with a field setter method with a filterArguments
- Closed
- relates to
-
JDK-8000999 backport of JSR 292 to 7u
- Closed