Several tests on linux crash like this:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd96584fd7c, pid=11126, tid=140571679655696
#
# JRE version: 7.0-b147
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22.0-b02-internal-201109060011.never.7051798-fastdebug compiled mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x7ced7c] JNIHandleBlock::release_block(JNIHandleBlock*, Thread*)+0x3c
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
The problem is misalignment of the stack when calling throw WrongMethodTypeException. The other uses of generate_throw_exception always call it with an aligned stack but method handles don't enforce alignment while shifting arguments around.