Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Runtime
-
Labels:None
-
Number of attachments :
Description
We set the finalizer method of a class after the class is resolved. Resolving a class is not unpreemptible or uninterruptible and neither is the call to findVirtualMethod, therefore there is a race:
1) we publish a class as resolved
2) we call findVirtualMethod hitting the prologue yield point and scheduling a different thread
3) we create an object of the class and don't register the object with the finalizer thread (as hasFinalizer will return false)
4) the object gets garbage collected and the finalizer isn't run
I believe we shouldn't be publish a class as resolved until we have set its finalizeMethod, this will require an internal findVirtualMethod that doesn't check isResolved.
Issue Links
| This issue is related to: | ||||
| RVM-440 | Poisoned tests failing in finalizer thread |
|
|
|
we won't create an instance of an object until it's state is initialized.