JDK-8183925 : Decouple crash protection from watcher thread
Type:Enhancement
Component:hotspot
Sub-Component:runtime
Affected Version:10
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2017-07-06
Updated:2024-09-11
Resolved:2017-07-07
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.
David,
static bool is_crash_protected(Thread* thr) {
return _crash_protection != NULL && _protected_thread == thr;
}
The _protected_thread can never be NULL if _crash_protection is none NULL.
Which this assert protected against:
assert(_protected_thread != NULL, "Cannot crash protect a NULL thread");
So if we are in early startup and current thread is NULL, it can never be crash protected.
Thus we either have a different thread crash protected e.g.
_crash_protection != NULL is true, but _protected_thread == thr will be false, so is_crash_protected will return false.
Or _crash_protection != NULL is false and we will return false.
18-08-2017
Robbin,
This assertion looks wrong to me:
+ assert(!os::ThreadCrashProtection::is_crash_protected(Thread::current_or_null()),
+ "malloc() not allowed when crash protection is set");
If the current thread is NULL, due to call through early os::malloc, and crash protection is not set, is_crash_protected will incorrectly report true because NULL==NULL. The assertion will then fire when it should not.