JDK-8160551 : assert(c == Bytecodes::_putfield) failed: must be putfield
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7,8,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-29
  • Updated: 2017-11-29
  • Resolved: 2016-06-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u171Fixed 8u152Fixed 9 b128Fixed
Related Reports
Relates :  
Relates :  
Description
hotspot/src/share/vm/interpreter/rewriter.cpp:436), pid=31065, tid=9400
#  assert(c == Bytecodes::_putfield) failed: must be putfield

Current thread (0xd08f0400):  JavaThread "Thread-42908" daemon [_thread_in_vm, id=9400, stack(0xcfbaf000,0xcfc00000)]

Stack: [0xcfbaf000,0xcfc00000],  sp=0xcfbfe730,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x14aea37]  VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned int)+0x137
V  [libjvm.so+0x14af730]  VMError::report_and_die(Thread*, char const*, int, char const*, char const*, char*)+0x30
V  [libjvm.so+0x932220]  report_vm_error(char const*, int, char const*, char const*, ...)+0x60
V  [libjvm.so+0x12c5a7c]  Rewriter::scan_method(Method*, bool, bool*)+0xcbc
V  [libjvm.so+0x12c5bc5]  Rewriter::rewrite_bytecodes(Thread*)+0xe5
V  [libjvm.so+0x12c6e82]  Rewriter::Rewriter(instanceKlassHandle, constantPoolHandle const&, Array<Method*>*, Thread*)+0x702
V  [libjvm.so+0x12c7e50]  Rewriter::rewrite(instanceKlassHandle, Thread*)+0x140
V  [libjvm.so+0xc45c21]  InstanceKlass::rewrite_class(Thread*)+0xa1
V  [libjvm.so+0xc4c72f]  InstanceKlass::link_class_impl(instanceKlassHandle, bool, Thread*)+0x50f
V  [libjvm.so+0xc4c99a]  InstanceKlass::link_class(Thread*)+0xca
V  [libjvm.so+0xdd3547]  get_class_declared_methods_helper(JNIEnv_*, _jclass*, unsigned char, bool, Klass*, Thread*)+0x1f7
V  [libjvm.so+0xde6ad0]  JVM_GetClassDeclaredConstructors+0x100
J 1072 java.lang.Class.getDeclaredConstructors0(Z)[Ljava/lang/reflect/Constructor; java.base@9-internal (0 bytes) @ 0xf2c5e649 [0xf2c5e5c0+0x00000089]
J 1071 C2 java.lang.Class.privateGetDeclaredConstructors(Z)[Ljava/lang/reflect/Constructor; java.base@9-internal (82 bytes) @ 0xf2c79060 [0xf2c78fe0+0x00000080]
J 1229 C2 java.lang.Class.newInstance()Ljava/lang/Object; java.base@9-internal (147 bytes) @ 0xf2cc88b0 [0xf2cc8800+0x000000b0]
J 873 C2 vm.mlvm.anonloader.share.StressClassLoadingTest$1.run()V (128 bytes) @ 0xf2c266d4 [0xf2c265a0+0x00000134]
v  ~StubRoutines::call_stub
V  [libjvm.so+0xc92241]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x761
V  [libjvm.so+0x117b7c9]  os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*), JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x19
V  [libjvm.so+0xc8fd58]  JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x2d8
V  [libjvm.so+0xc8ff5e]  JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*)+0x8e
V  [libjvm.so+0xdd0f47]  thread_entry(JavaThread*, Thread*)+0xa7
V  [libjvm.so+0x1417320]  JavaThread::thread_main_inner()+0x220
V  [libjvm.so+0x14175df]  JavaThread::run()+0x1ef
V  [libjvm.so+0x117ed94]  thread_native_entry(Thread*)+0x124
C  [libpthread.so.0+0x6bc9]
C  [libc.so.6+0xe2c9e]  clone+0x5e
Comments
Hi Coleen, thank you for taking care of this issue! Best regards, Zoltan
30-06-2016

> Is it possible that Zoltan's work on JDK-8160527 will solve the problems No, I just reviewed that change.
29-06-2016

(gdb) #7 0x00007fadb2868200 in Rewriter::scan_method (this=0x7fab8c8b8fe0, method=0x7fab8c256ad8, reverse=false, invokespecial_error=0x7fab8c8b8e60) at /home/cphillim/hg.local/9putfield/hotspot/src/share/vm/interpreter/rewriter.cpp:436 436 assert(c == Bytecodes::_putfield, "must be putfield"); (gdb) list 431 assert(c == Bytecodes::_putstatic, "must be putstatic"); 432 if (!method->is_static_initializer()) { 433 fd.set_has_initialized_final_update(true); 434 } 435 } else { 436 assert(c == Bytecodes::_putfield, "must be putfield"); 437 if (!method->is_object_initializer()) { 438 fd.set_has_initialized_final_update(true); 439 } 440 } (gdb) print c $1 = Bytecodes::_putstatic (gdb) print method->name()->as_C_string() $4 = 0x7fad30001240 "<clinit>" (gdb) print /x fd.access_flags() $9 = {_flags = 0x91} JVM_ACC_PUBLIC | JVM_ACC_FINAL | JVM_ACC_VARARGS The test does bytecode and classfile manipulation and expects to find this error later.
29-06-2016

Is it possible that Zoltan's work on JDK-8160527 will solve the problems introduced with JDK-8157181? <some day I will learn to type>
29-06-2016

This code was introduced with this fix.
29-06-2016