Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
47d1d89b
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
47d1d89b
编写于
6月 19, 2017
作者:
S
stuefe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8181419: Race in jdwp invoker handling may lead to crashes or invalid results
Reviewed-by: sspitsyn, sgehwolf, clanger
上级
48d706bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
25 deletion
+20
-25
src/share/back/invoker.c
src/share/back/invoker.c
+20
-25
未找到文件。
src/share/back/invoker.c
浏览文件 @
47d1d89b
...
...
@@ -211,30 +211,6 @@ createGlobalRefs(JNIEnv *env, InvokeRequest *request)
return
error
;
}
/*
* Delete saved global references - if any - for:
* - a potentially thrown Exception
* - a returned refernce/array value
* See invoker_doInvoke() and invoke* methods where global references
* are being saved.
*/
static
void
deletePotentiallySavedGlobalRefs
(
JNIEnv
*
env
,
InvokeRequest
*
request
)
{
/* Delete potentially saved return value */
if
((
request
->
invokeType
==
INVOKE_CONSTRUCTOR
)
||
(
returnTypeTag
(
request
->
methodSignature
)
==
JDWP_TAG
(
OBJECT
))
||
(
returnTypeTag
(
request
->
methodSignature
)
==
JDWP_TAG
(
ARRAY
)))
{
if
(
request
->
returnValue
.
l
!=
NULL
)
{
tossGlobalRef
(
env
,
&
(
request
->
returnValue
.
l
));
}
}
/* Delete potentially saved exception */
if
(
request
->
exception
!=
NULL
)
{
tossGlobalRef
(
env
,
&
(
request
->
exception
));
}
}
/*
* Delete global argument references from the request which got put there before a
* invoke request was carried out. See fillInvokeRequest().
...
...
@@ -744,6 +720,7 @@ invoker_completeInvokeRequest(jthread thread)
jint
id
;
InvokeRequest
*
request
;
jboolean
detached
;
jboolean
mustReleaseReturnValue
=
JNI_FALSE
;
JDI_ASSERT
(
thread
);
...
...
@@ -787,6 +764,13 @@ invoker_completeInvokeRequest(jthread thread)
id
=
request
->
id
;
exc
=
request
->
exception
;
returnValue
=
request
->
returnValue
;
/* Release return value and exception references, but delay the release
* until after the return packet was sent. */
mustReleaseReturnValue
=
request
->
invokeType
==
INVOKE_CONSTRUCTOR
||
returnTypeTag
(
request
->
methodSignature
)
==
JDWP_TAG
(
OBJECT
)
||
returnTypeTag
(
request
->
methodSignature
)
==
JDWP_TAG
(
ARRAY
);
}
/*
...
...
@@ -801,6 +785,12 @@ invoker_completeInvokeRequest(jthread thread)
*/
deleteGlobalArgumentRefs
(
env
,
request
);
/* From now on, do not access the request structure anymore
* for this request id, because once we give up the invokerLock it may
* be immediately reused by a new invoke request.
*/
request
=
NULL
;
/*
* Give up the lock before I/O operation
*/
...
...
@@ -821,7 +811,12 @@ invoker_completeInvokeRequest(jthread thread)
*/
eventHandler_lock
();
// for proper lock order
debugMonitorEnter
(
invokerLock
);
deletePotentiallySavedGlobalRefs
(
env
,
request
);
if
(
mustReleaseReturnValue
&&
returnValue
.
l
!=
NULL
)
{
tossGlobalRef
(
env
,
&
returnValue
.
l
);
}
if
(
exc
!=
NULL
)
{
tossGlobalRef
(
env
,
&
exc
);
}
debugMonitorExit
(
invokerLock
);
eventHandler_unlock
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录