Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8258243: C2: assert failed ("Bad derived pointer") with -XX:+VerifyRegisterAllocator #2005

wants to merge 1 commit into from


Copy link

@chhagedorn chhagedorn commented Jan 8, 2021

The base pointer verification code in the register allocator checks that a base for a derived constant node is always NULL. However, this is not the case if the offset is zero (returns on L1744):

const TypePtr *tj = derived->bottom_type()->isa_ptr();
// If its an OOP with a non-zero offset, then it is derived.
if( tj == NULL || tj->_offset == 0 ) {
derived_base_map[derived->_idx] = derived;
return derived;
// Derived is NULL+offset? Base is NULL!
if( derived->is_Con() ) {
Node *base = _matcher.mach_null();
assert(base != NULL, "sanity");
if (base->in(0) == NULL) {
// Initialize it once and make it shared:
// set control to _root and place it into Start block
// (where top() node is placed).
base->init_req(0, _cfg.get_root_node());

This case is added to the verification code which fixes the reported failing testcases.

I additionally added a hello world test to sanity check the -XX:+VerifyRegisterAllocator flag.



  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed


  • JDK-8258243: C2: assert failed ("Bad derived pointer") with -XX:+VerifyRegisterAllocator



$ git fetch pull/2005/head:pull/2005
$ git checkout pull/2005

Copy link

@bridgekeeper bridgekeeper bot commented Jan 8, 2021

👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.


@openjdk openjdk bot added the rfr label Jan 8, 2021
Copy link

@openjdk openjdk bot commented Jan 8, 2021

@chhagedorn The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.


Copy link

@mlbridge mlbridge bot commented Jan 8, 2021



Copy link

@vnkozlov vnkozlov left a comment

Good. Make sense.


Copy link

@openjdk openjdk bot commented Jan 8, 2021

@chhagedorn This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file for details.

After integration, the commit message for the final commit will be:

8258243: C2: assert failed ("Bad derived pointer") with -XX:+VerifyRegisterAllocator

Reviewed-by: kvn, thartmann

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 98 new commits pushed to the master branch:

  • b72de3c: 8259385: Cleanup unused assignment
  • 9154f64: 8254973: CompletableFuture.ThreadPerTaskExecutor does not throw NPE in #execute
  • e7c1740: 8258187: IllegalMonitorStateException in ArrayBlockingQueue
  • 11d5b04: 8258217: PriorityBlockingQueue constructor spec and behavior mismatch
  • 65ca5c6: 8048109: JToggleButton does not fire actionPerformed under certain conditions
  • 81db63e: 8259517: Incorrect test path in test cases
  • 270014a: 8234131: Miscellaneous changes imported from jsr166 CVS 2021-01
  • 63e3bd7: 8246677: LinkedTransferQueue and SynchronousQueue synchronization updates
  • 5cfa8c9: 8246585: ForkJoin updates
  • 6472104: 6278172: TextComponent.getSelectedText() throws StringIndexOutOfBoundsException
  • ... and 88 more:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.


@openjdk openjdk bot added the ready label Jan 8, 2021
Copy link

@TobiHartmann TobiHartmann left a comment

Looks good.


Copy link
Member Author

@chhagedorn chhagedorn commented Jan 11, 2021

@vnkozlov @TobiHartmann Thank you for your reviews!


Copy link
Member Author

@chhagedorn chhagedorn commented Jan 12, 2021



@openjdk openjdk bot closed this Jan 12, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jan 12, 2021
Copy link

@openjdk openjdk bot commented Jan 12, 2021

@chhagedorn Since your change was applied there have been 136 commits pushed to the master branch:

  • 4663704: 8259583: Remove unused decode_env::_codeBuffer
  • 9d4e84f: 8259565: Zero: compiler/runtime/criticalnatives fails because CriticalJNINatives is not supported
  • 98ccfbf: 8255710: Opensource unit/regression tests for CMM
  • 61c5b95: 7194219: java/awt/Component/UpdatingBootTime/UpdatingBootTime.html fails on Linux
  • 77f6290: 8258254: Move PtrQueue flush to PtrQueueSet subclasses
  • 2255ab7: 8258810: Improve enum traits
  • ae0532e: 8259044: JVM lacks data type qualifier when using -XX:+PrintAssembly with AArch64-Neon backend
  • b378f54: Merge
  • 2cb271e: 8253996: Javac error on jdk16 build 18: invalid flag: -Xdoclint:-missing
  • d60a937: 8259028: ClassCastException when using custom filesystem with wrapper FileChannel impl
  • ... and 126 more:

Your commit was automatically rebased without conflicts.

Pushed as commit a3561ae.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.


@chhagedorn chhagedorn deleted the JDK-8258243 branch Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants