Skip to content

Commit 0aa2bad

Browse files
JITServer: handle non-null compilation
When a JITServer stream failure is thrown, sometimes setting the compilation object to NULL can be skiped to head straight into exception handling. This causes an assert to be tripped. In this particular case, there is a front-end call in outOfProcessCompilationEnd (within computeDataForCHTableCommit) which can cause a stream error. Since it isn't guarded by a global try-catch, it results in the given assert being tripped. Addresses this issue: #23845
1 parent 3c076ab commit 0aa2bad

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

runtime/compiler/control/CompilationThread.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8747,6 +8747,13 @@ TR_MethodMetaData *TR::CompilationInfoPerThreadBase::wrappedCompile(J9PortLibrar
87478747
diagnostic("Forced Option Set %d\n", optionSetIndex);
87488748
}
87498749
}
8750+
if (that->_compiler) {
8751+
// If JITServer is enabled, this will send messages
8752+
// to the client to get the retained method set and
8753+
// cache it locally. This is needed for
8754+
// postCompilationTasks, see issue #23845
8755+
that->_compiler->retainedMethods();
8756+
}
87508757
} catch (const std::exception &e) {
87518758
// TODO: we must handle OOM cases when we abort the compilation right from the start.
87528759
// Or eliminate the code that throws (or the code could also look at how the expensive the compilation is)

runtime/compiler/env/J9RetainedMethodSet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,8 @@ void J9::RepeatRetainedMethodsAnalysis::getDataForClient(TR::Compilation *comp,
583583
}
584584

585585
TR_ResolvedMethod *keepaliveMethod = NULL;
586+
// retainedMethods is guaranteed to exist, so no messages
587+
// will be sent to the server. See issue #23845
586588
auto keepaliveMethodsIter = comp->retainedMethods()->keepaliveMethods();
587589
while (keepaliveMethodsIter.next(&keepaliveMethod)) {
588590
keepaliveMethods.push_back(static_cast<TR_ResolvedJ9JITServerMethod *>(keepaliveMethod)->getRemoteMirror());

0 commit comments

Comments
 (0)