JDK-8205118 : CodeStrings::copy() assertion caused by -XX:+VerifyOops -XX:+PrintStubCode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: generic
  • Submitted: 2018-06-15
  • Updated: 2024-11-18
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Running on a debug build the following:
     java -XX:+VerifyOops -XX:+PrintStubCode -version

Is sufficient to cause an assertion to trip:

#  Internal Error (/home/stuart/jdk/src/hotspot/share/asm/codeBuffer.cpp:1078), pid=34696, tid=34699
#  assert(_offset >= 0) failed: offset for non comment?

Backing out JDK-8204680 is sufficient to get it to work again.

Comments
Starts to work with JDK 12+7. Assert with JDK 12+6: assert(false) failed: DEBUG MESSAGE: verify_oop: rdi: broken oop
27-01-2023

Is this still an issue? I cannot reproduce it with JDK 16.
25-09-2020

ILW = Assert failure with -XX:+VerifyOops -XX:+PrintStubCode usage; diagnostics issue; none = MLH = P4 (Please note other existing known issues present with -XX:+VerifyOops usage. Linked to related JDK-8187078. Fix version here may be changed to 'tbd_feature' if required!)
18-06-2018

I think that this is a pre-existing bug in CodeStrings::copy(CodeStrings& other). It wasn't caused by this patch to 8204680, but it was revealed by it. CodeStrings::copy should be able to copy any legitimate CodeStrings without aborting. It's not clear to me what the assertion is for. This is the simplest fix: diff -r 1fd4844371bb src/hotspot/share/asm/codeBuffer.cpp --- a/src/hotspot/share/asm/codeBuffer.cpp Mon Jun 11 15:32:43 2018 +0100 +++ b/src/hotspot/share/asm/codeBuffer.cpp Mon Jun 18 13:38:33 2018 +0100 @@ -1152,7 +1152,7 @@ CodeString* n = other._strings; CodeString** ps = &_strings; while (n != NULL) { - *ps = new CodeString(n->string(),n->offset()); + *ps = new CodeString(n->string(),n->_offset); ps = &((*ps)->_next); n = n->next(); }
18-06-2018