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

8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB #3336

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -1481,6 +1481,9 @@ void PhaseIterGVN::subsume_node( Node *old, Node *nn ) {
temp->init_req(0,nn); // Add a use to nn to prevent him from dying

This comment has been minimized.

@TobiHartmann

TobiHartmann Apr 7, 2021
Member

Just wondering, why do we even need this? Without that code, remove_dead_node(old) would kill nn as well if it becomes dead.

This comment has been minimized.

@huishi-hs

huishi-hs Apr 7, 2021
Author

Thanks for your review!

Checking code history, this code is quite old. From comments around, it doesn't want nn removed directly in PhaseIterGVN::subsume_node and leaves optimization to next GVN iteration.

In my understanding, it might save callers to insert codes checking if "nn" is removed/dead at every subsume_node/replace_node callsite, simplifies implementation.

8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1479) // Smash all inputs to 'old', isolating him completely
2a0815a hotspot/src/share/vm/opto/phaseX.cpp (Tobias Hartmann 2014-06-02 08:07:29 +0200 1480) Node *temp = new Node(1);
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1481) temp->init_req(0,nn); // Add a use to nn to prevent him from dying
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1482) remove_dead_node( old );
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1483) temp->del_req(0); // Yank bogus edge

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Contributor

Note nn could be new node created during parsing which does not have users yet. that is why we need to keep it

remove_dead_node( old );
temp->del_req(0); // Yank bogus edge
if (nn != NULL && nn->outcnt() == 0) {
_worklist.push(nn);
}
#ifndef PRODUCT
if( VerifyIterativeGVN ) {
for ( int i = 0; i < _verify_window_size; i++ ) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,15 @@
* @run main/othervm -XX:+UsePerfData -Xmx128m ThreadCpuTimesDeadlock
*/

/*
* @test
* @bug 8264649
* @summary OSR compiled method crash when UseTLAB is off
* @requires vm.debug
* @modules java.management/sun.management
* @run main/othervm -XX:-UseTLAB -XX:+UsePerfData -Xmx128m ThreadCpuTimesDeadlock
*/

import java.lang.management.ManagementFactory;
import javax.management.JMException;
import javax.management.MBeanServer;
ProTip! Use n and p to navigate between commits in a pull request.