log
graph
tags
bookmarks
branches
changeset
browse
file
diff
comparison
annotate
file log
raw
help
Mercurial
>
hg
>
Members
>
kono
>
jpf-core
log src/main/gov/nasa/jpf/jvm/bytecode/MONITORENTER.java @ 24:
6774e2e08d37
Find changesets by keywords (author, files, the commit message), revision number or hash, or
revset expression
.
less
more
|
(0)
tip
age
author
description
Tue, 21 Apr 2015 00:34:15 -0700
Peter Mehlitz
the fix I would have liked to avoid - apparently hotspot internally does nested locking during class init, which can lead to deadlocks such as described in http://ternarysearch.blogspot.ru/2013/07/static-initialization-deadlock.html. Actually, it's not a regular deadlock since core dumps still list the threads as runnable, althouth it doesn't seem to be a livelock either. In any case, it can be simulated by nested locking and clinit execution, and it is such a serious defect that we want to be able to catch it. The general mechanism is to replace the disparate (but properly ordered) direct clinit calls of the generic ClassInfo.initializeClass() with a single sythetic method that includes all required locking (bottom up), clinit calls / class status change (top down), and unlocking (top down). We also need to add a synthetic insn to defer changing the class status of classes that don't have clinits(), or otherwise the correct lock/unlock order will not amount to anything if the hierarchy is entered through one of the clinit-absent classes. Now we get proper deadlocks if there are concurrent cyclic dependencies during class resolution. However, this can be such a state exploder that we certainly don't want this as the default behavior, especially since it probably is hotspot specific. Nested class init locking is therefore controlled by jvm.nested_init and respective jvm.nested_init.include/exclude options. Added a NestedInitTest to demonstrate use. Thanks to Lilia Abdulina for bringing this long forgotten issue up
Fri, 23 Jan 2015 10:14:01 -0800
Peter Mehlitz
initial v8 import (history reset)
less
more
|
(0)
tip