Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
c7253cc6
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c7253cc6
编写于
7月 23, 2013
作者:
M
minqi
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
f0322f47
799ce8d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
28 deletion
+23
-28
test/runtime/jsig/Test8017498.sh
test/runtime/jsig/Test8017498.sh
+22
-25
test/runtime/jsig/TestJNI.c
test/runtime/jsig/TestJNI.c
+1
-3
未找到文件。
test/runtime/jsig/Test8017498.sh
浏览文件 @
c7253cc6
...
...
@@ -26,8 +26,9 @@
##
## @test Test8017498.sh
## @bug 8017498
## @bug 8020791
## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
## @run shell Test8017498.sh
## @run shell
/timeout=30
Test8017498.sh
##
if
[
"
${
TESTSRC
}
"
=
""
]
...
...
@@ -46,17 +47,13 @@ case "$OS" in
echo
"Testing on Linux"
if
[
"
$VM_BITS
"
=
"64"
]
then
LD_PRELOAD
=
${
TESTJAVA
}${
FS
}
jre
${
FS
}
lib
${
FS
}
amd64
${
FS
}
libjsig.so
MY_
LD_PRELOAD
=
${
TESTJAVA
}${
FS
}
jre
${
FS
}
lib
${
FS
}
amd64
${
FS
}
libjsig.so
else
LD_PRELOAD
=
${
TESTJAVA
}${
FS
}
jre
${
FS
}
lib
${
FS
}
i386
${
FS
}
libjsig.so
MY_
LD_PRELOAD
=
${
TESTJAVA
}${
FS
}
jre
${
FS
}
lib
${
FS
}
i386
${
FS
}
libjsig.so
fi
echo
LD_PRELOAD
=
${
LD_PRELOAD
}
export
LD_PRELOAD
=
${
LD_PRELOAD
}
echo
MY_LD_PRELOAD
=
${
MY_LD_PRELOAD
}
;;
*
)
NULL
=
NUL
PS
=
";"
FS
=
"
\\
"
echo
"Test passed; only valid for Linux"
exit
0
;
;;
...
...
@@ -67,29 +64,29 @@ THIS_DIR=.
cp
${
TESTSRC
}${
FS
}*
.java
${
THIS_DIR
}
${
TESTJAVA
}${
FS
}
bin
${
FS
}
javac
*
.java
gcc
-fPIC
-shared
-o
${
TESTSRC
}${
FS
}
libTestJNI.so
-I
${
TESTJAVA
}${
FS
}
include
-I
${
TESTJAVA
}${
FS
}
include
${
FS
}
linux
${
TESTSRC
}${
FS
}
TestJNI.c
gcc
-DLINUX
-fPIC
-shared
\
-o
${
TESTSRC
}${
FS
}
libTestJNI.so
\
-I
${
TESTJAVA
}${
FS
}
include
\
-I
${
TESTJAVA
}${
FS
}
include
${
FS
}
linux
\
${
TESTSRC
}${
FS
}
TestJNI.c
if
[
$?
!=
0
]
then
echo
"WARNING: the gcc command failed."
2>&1
fi
# run the java test in the background
echo
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Djava
.library.path
=
${
TESTSRC
}${
FS
}
-server
TestJNI 100
>
test.out 2>&1 &
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
-Djava
.library.path
=
${
TESTSRC
}${
FS
}
-server
TestJNI 100
>
test.out 2>&1 &
# obtain the process id
C_PID
=
$!
cmd
=
"LD_PRELOAD=
$MY_LD_PRELOAD
\
${
TESTJAVA
}${
FS
}
bin
${
FS
}
java
\
-Djava.library.path=
${
TESTSRC
}${
FS
}
-server TestJNI 100"
echo
"
$cmd
> test.out 2>&1"
eval
$cmd
>
test.out 2>&1
# sleep for 1s
sleep
1
# reset LD_PRELOAD
unset
LD_PRELOAD
# check the output file (test.out)
grep
"old handler"
test.out
>
${
NULL
}
if
[
$?
=
0
]
then
echo
"Test Passed"
exit
0
else
kill
-9
${
C_PID
}
echo
"Test Failed"
exit
1
fi
echo
"Test Failed"
exit
1
test/runtime/jsig/TestJNI.c
浏览文件 @
c7253cc6
...
...
@@ -21,9 +21,9 @@
* questions.
*/
#define _GNU_SOURCE // for the definition of REG_RIP in ucontext.h
#include <stdio.h>
#include <jni.h>
#define __USE_GNU
#include <signal.h>
#include <sys/ucontext.h>
...
...
@@ -42,8 +42,6 @@ void sig_handler(int sig, siginfo_t *info, ucontext_t *context) {
JNIEXPORT
void
JNICALL
Java_TestJNI_doSomething
(
JNIEnv
*
env
,
jclass
klass
,
jint
val
)
{
struct
sigaction
act
;
struct
sigaction
oact
;
pthread_attr_t
attr
;
stack_t
stack
;
act
.
sa_flags
=
SA_ONSTACK
|
SA_RESTART
|
SA_SIGINFO
;
sigfillset
(
&
act
.
sa_mask
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录