Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
a63bf9a0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a63bf9a0
编写于
8月 16, 2012
作者:
C
coffeys
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7056731: Race condition in CORBA code causes re-use of ABORTed connections
Reviewed-by: lancea Contributed-by: d.macdonald@auckland.ac.nz
上级
1889def4
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
316 addition
and
1 deletion
+316
-1
test/Makefile
test/Makefile
+2
-1
test/com/sun/corba/cachedSocket/7056731.sh
test/com/sun/corba/cachedSocket/7056731.sh
+119
-0
test/com/sun/corba/cachedSocket/Hello.idl
test/com/sun/corba/cachedSocket/Hello.idl
+31
-0
test/com/sun/corba/cachedSocket/HelloClient.java
test/com/sun/corba/cachedSocket/HelloClient.java
+67
-0
test/com/sun/corba/cachedSocket/HelloServer.java
test/com/sun/corba/cachedSocket/HelloServer.java
+97
-0
未找到文件。
test/Makefile
浏览文件 @
a63bf9a0
...
...
@@ -507,7 +507,8 @@ JDK_ALL_TARGETS += jdk_misc
JDK_DEFAULT_TARGETS
+=
jdk_misc
jdk_misc
:
$(call TestDirs
,
\
demo/jvmti demo/zipfs javax/naming javax/script
\
javax/smartcardio com/sun/jndi com/sun/xml sun/misc)
javax/smartcardio com/sun/jndi com/sun/xml
\
com/sun/corba sun/misc)
$(
call
RunAgentvmBatch
)
# Stable agentvm testruns (minus items from PROBLEM_LIST)
...
...
test/com/sun/corba/cachedSocket/7056731.sh
0 → 100644
浏览文件 @
a63bf9a0
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# @test
# @bug 7056731
# @summary Race condition in CORBA code causes re-use of ABORTed connections
#
# @run shell 7056731.sh
#
OS
=
`
uname
-s
`
case
"
$OS
"
in
SunOS
|
Linux
|
Darwin
)
PS
=
":"
FS
=
"/"
;;
Windows
*
|
CYGWIN
*
)
PS
=
";"
FS
=
"
\\
"
;;
*
)
echo
"Unrecognized system!"
exit
1
;
;;
esac
if
[
"
${
TESTJAVA
}
"
=
""
]
;
then
echo
"TESTJAVA not set. Test cannot execute. Failed."
exit
1
fi
JAVA
=
"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java"
PORT
=
1052
cp
-r
${
TESTSRC
}${
FS
}*
.java
${
TESTSRC
}${
FS
}
Hello.idl
.
echo
"Testing...please wait"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
idlj
-fall
Hello.idl
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
*
.java HelloApp/
*
.java
echo
"starting orbd"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
orbd
-ORBInitialPort
$PORT
-ORBInitialHost
localhost &
ORB_PROC
=
$!
sleep
2
#give orbd time to start
echo
"started orb"
echo
"starting server"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-cp
.
HelloServer
-ORBInitialPort
$PORT
-ORBInitialHost
localhost &
SERVER_PROC
=
$!
sleep
2
#give server time to start
echo
"started server"
echo
"starting client (debug mode)"
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-cp
.
-agentlib
:jdwp
=
transport
=
dt_socket,server
=
y,address
=
8000 HelloClient
-ORBInitialPort
$PORT
-ORBInitialHost
localhost
>
client.
$$
2>&1 &
JVM_PROC
=
$!
sleep
2
#give jvm/debugger/client time to start
echo
"started client (debug mode)"
echo
"starting debugger and issuing commands"
(
sleep
2
;
echo
"stop in com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter"
;
sleep
2
;
echo
"run"
;
sleep
2
;
echo
"cont"
;
sleep
2
;
echo
"cont"
;
sleep
2
;
echo
"cont"
;
sleep
2
;
echo
"suspend 1"
;
sleep
2
;
kill
-9
$SERVER_PROC
&> /dev/null
;
sleep
2
;
echo
"cont"
;
sleep
2
;
echo
"thread 1"
sleep
2
;
echo
"clear com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.unregisterWaiter"
sleep
2
;
echo
"resume 1"
;
)
|
${
TESTJAVA
}${
FS
}
bin
${
FS
}
jdb
-connect
com.sun.jdi.SocketAttach:hostname
=
localhost,port
=
8000
sleep
5
# give time for Client to throw exception
# JVM_PROC should have exited but just in case, include it.
kill
-9
$ORB_PROC
$JVM_PROC
grep
"ORBUtilSystemException.writeErrorSend"
client.
$$
result
=
$?
if
[
$result
-eq
0
]
then
echo
"Failed"
exitCode
=
1
;
else
echo
"Passed"
exitCode
=
0
fi
rm
-rf
out.
$$
client.
$$
exit
${
exitCode
}
test/com/sun/corba/cachedSocket/Hello.idl
0 → 100644
浏览文件 @
a63bf9a0
/*
*
Copyright
(
c
)
2012
,
Oracle
and
/
or
its
affiliates
.
All
rights
reserved
.
*
DO
NOT
ALTER
OR
REMOVE
COPYRIGHT
NOTICES
OR
THIS
FILE
HEADER
.
*
*
This
code
is
free
software
; you can redistribute it and/or modify it
*
under
the
terms
of
the
GNU
General
Public
License
version
2
only
,
as
*
published
by
the
Free
Software
Foundation
.
*
*
This
code
is
distributed
in
the
hope
that
it
will
be
useful
,
but
WITHOUT
*
ANY
WARRANTY
; without even the implied warranty of MERCHANTABILITY or
*
FITNESS
FOR
A
PARTICULAR
PURPOSE
.
See
the
GNU
General
Public
License
*
version
2
for
more
details
(
a
copy
is
included
in
the
LICENSE
file
that
*
accompanied
this
code
)
.
*
*
You
should
have
received
a
copy
of
the
GNU
General
Public
License
version
*
2
along
with
this
work
; if not, write to the Free Software Foundation,
*
Inc
.
,
51
Franklin
St
,
Fifth
Floor
,
Boston
,
MA
02110
-
1301
USA
.
*
*
Please
contact
Oracle
,
500
Oracle
Parkway
,
Redwood
Shores
,
CA
94065
USA
*
or
visit
www
.
oracle.com
if
you
need
additional
information
or
have
any
*
questions
.
*/
module
HelloApp
{
interface
Hello
{
string
sayHello
()
;
oneway
void
shutdown
()
;
}
;
}
;
test/com/sun/corba/cachedSocket/HelloClient.java
0 → 100644
浏览文件 @
a63bf9a0
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
HelloApp.*
;
import
org.omg.CosNaming.*
;
import
org.omg.CosNaming.NamingContextPackage.*
;
import
org.omg.CORBA.*
;
public
class
HelloClient
{
static
Hello
helloImpl
;
public
static
void
main
(
String
args
[])
{
try
{
// create and initialize the ORB
ORB
orb
=
ORB
.
init
(
args
,
null
);
// get the root naming context
org
.
omg
.
CORBA
.
Object
objRef
=
orb
.
resolve_initial_references
(
"NameService"
);
// Use NamingContextExt instead of NamingContext. This is
// part of the Interoperable naming Service.
NamingContextExt
ncRef
=
NamingContextExtHelper
.
narrow
(
objRef
);
// resolve the Object Reference in Naming
String
name
=
"Hello"
;
helloImpl
=
HelloHelper
.
narrow
(
ncRef
.
resolve_str
(
name
));
System
.
out
.
println
(
"Obtained a handle on server object: "
+
helloImpl
);
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
try
{
System
.
out
.
println
(
helloImpl
.
sayHello
());
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Exception: "
+
e
.
getMessage
());
e
.
printStackTrace
();
}
Thread
.
sleep
(
2000
);
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"ERROR : "
+
e
)
;
e
.
printStackTrace
(
System
.
out
);
}
}
}
test/com/sun/corba/cachedSocket/HelloServer.java
0 → 100644
浏览文件 @
a63bf9a0
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import
HelloApp.*
;
import
org.omg.CosNaming.*
;
import
org.omg.CosNaming.NamingContextPackage.*
;
import
org.omg.CORBA.*
;
import
org.omg.PortableServer.*
;
import
org.omg.PortableServer.POA
;
import
java.util.Properties
;
class
HelloImpl
extends
HelloPOA
{
private
ORB
orb
;
public
void
setORB
(
ORB
orb_val
)
{
orb
=
orb_val
;
}
// implement sayHello() method
public
String
sayHello
()
{
return
"\nHello world !!\n"
;
}
// implement shutdown() method
public
void
shutdown
()
{
orb
.
shutdown
(
false
);
}
}
public
class
HelloServer
{
public
static
void
main
(
String
args
[])
{
try
{
// create and initialize the ORB
ORB
orb
=
ORB
.
init
(
args
,
null
);
// get reference to rootpoa & activate the POAManager
POA
rootpoa
=
POAHelper
.
narrow
(
orb
.
resolve_initial_references
(
"RootPOA"
));
rootpoa
.
the_POAManager
().
activate
();
// create servant and register it with the ORB
HelloImpl
helloImpl
=
new
HelloImpl
();
helloImpl
.
setORB
(
orb
);
// get object reference from the servant
org
.
omg
.
CORBA
.
Object
ref
=
rootpoa
.
servant_to_reference
(
helloImpl
);
Hello
href
=
HelloHelper
.
narrow
(
ref
);
// get the root naming context
org
.
omg
.
CORBA
.
Object
objRef
=
orb
.
resolve_initial_references
(
"NameService"
);
// Use NamingContextExt which is part of the Interoperable
// Naming Service (INS) specification.
NamingContextExt
ncRef
=
NamingContextExtHelper
.
narrow
(
objRef
);
// bind the Object Reference in Naming
String
name
=
"Hello"
;
NameComponent
path
[]
=
ncRef
.
to_name
(
name
);
ncRef
.
rebind
(
path
,
href
);
System
.
out
.
println
(
"HelloServer ready and waiting ..."
);
// wait for invocations from clients
while
(
true
)
{
orb
.
run
();
}
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"ERROR: "
+
e
);
e
.
printStackTrace
(
System
.
out
);
}
System
.
out
.
println
(
"HelloServer Exiting ..."
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录