mirror of https://github.com/sbt/sbt.git
Drop Thread.getName from use in computeID(thread) in TrapExit SecurityManager to fix #997.
This commit is contained in:
parent
ad60e6c794
commit
e16864f2e7
|
|
@ -73,7 +73,9 @@ object TrapExit
|
|||
/** Computes an identifier for a Thread that has a high probability of being unique within a single JVM execution. */
|
||||
private def computeID(t: Thread): ThreadID =
|
||||
// can't use t.getId because when getAccess first sees a Thread, it hasn't been initialized yet
|
||||
s"${hex(System.identityHashCode(t))}:${t.getName}"
|
||||
// can't use t.getName because calling it on AWT thread in certain circumstances generates a segfault (#997):
|
||||
// Apple AWT: +[ThreadUtilities getJNIEnvUncached] attempting to attach current thread after JNFObtainEnv() failed
|
||||
s"${hex(System.identityHashCode(t))}"
|
||||
|
||||
/** Waits for the given `thread` to terminate. However, if the thread state is NEW, this method returns immediately. */
|
||||
private def waitOnThread(thread: Thread, log: Logger)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
object O {
|
||||
def main(argv: Array[String]) {
|
||||
new java.awt.Color(0,0,0)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# in #997, creating an instance of an AWT class triggers a segfault
|
||||
# this verifies that is fixed
|
||||
> run
|
||||
Loading…
Reference in New Issue