mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8194482: Fix SIGSEGV in print_threads_compiling
Reviewed-by: kvn
This commit is contained in:
parent
b5fa820c6e
commit
f6c82cde45
2 changed files with 20 additions and 13 deletions
|
@ -2946,8 +2946,9 @@ void JavaThread::metadata_do(void f(Metadata*)) {
|
||||||
if (ct->env() != NULL) {
|
if (ct->env() != NULL) {
|
||||||
ct->env()->metadata_do(f);
|
ct->env()->metadata_do(f);
|
||||||
}
|
}
|
||||||
if (ct->task() != NULL) {
|
CompileTask* task = ct->task();
|
||||||
ct->task()->metadata_do(f);
|
if (task != NULL) {
|
||||||
|
task->metadata_do(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3001,10 +3002,10 @@ void JavaThread::print_on(outputStream *st) const {
|
||||||
_safepoint_state->print_on(st);
|
_safepoint_state->print_on(st);
|
||||||
#endif // PRODUCT
|
#endif // PRODUCT
|
||||||
if (is_Compiler_thread()) {
|
if (is_Compiler_thread()) {
|
||||||
CompilerThread* ct = (CompilerThread*)this;
|
CompileTask *task = ((CompilerThread*)this)->task();
|
||||||
if (ct->task() != NULL) {
|
if (task != NULL) {
|
||||||
st->print(" Compiling: ");
|
st->print(" Compiling: ");
|
||||||
ct->task()->print(st, NULL, true, false);
|
task->print(st, NULL, true, false);
|
||||||
} else {
|
} else {
|
||||||
st->print(" No compile task");
|
st->print(" No compile task");
|
||||||
}
|
}
|
||||||
|
@ -4712,9 +4713,15 @@ void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
|
||||||
ALL_JAVA_THREADS(thread) {
|
ALL_JAVA_THREADS(thread) {
|
||||||
if (thread->is_Compiler_thread()) {
|
if (thread->is_Compiler_thread()) {
|
||||||
CompilerThread* ct = (CompilerThread*) thread;
|
CompilerThread* ct = (CompilerThread*) thread;
|
||||||
if (ct->task() != NULL) {
|
|
||||||
|
// Keep task in local variable for NULL check.
|
||||||
|
// ct->_task might be set to NULL by concurring compiler thread
|
||||||
|
// because it completed the compilation. The task is never freed,
|
||||||
|
// though, just returned to a free list.
|
||||||
|
CompileTask* task = ct->task();
|
||||||
|
if (task != NULL) {
|
||||||
thread->print_name_on_error(st, buf, buflen);
|
thread->print_name_on_error(st, buf, buflen);
|
||||||
ct->task()->print(st, NULL, true, true);
|
task->print(st, NULL, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2066,7 +2066,7 @@ class CompilerThread : public JavaThread {
|
||||||
|
|
||||||
ciEnv* _env;
|
ciEnv* _env;
|
||||||
CompileLog* _log;
|
CompileLog* _log;
|
||||||
CompileTask* _task;
|
CompileTask* volatile _task; // print_threads_compiling can read this concurrently.
|
||||||
CompileQueue* _queue;
|
CompileQueue* _queue;
|
||||||
BufferBlob* _buffer_blob;
|
BufferBlob* _buffer_blob;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue