Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
843984e9
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看板
提交
843984e9
编写于
4月 02, 2013
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8009558: linked_md.c::dll_build_name can get stuck in an infinite loop
Reviewed-by: alanb, sspitsyn
上级
fa251e0a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
78 addition
and
112 deletion
+78
-112
src/share/back/export/sys.h
src/share/back/export/sys.h
+1
-1
src/share/back/transport.c
src/share/back/transport.c
+4
-4
src/share/demo/jvmti/hprof/hprof_md.h
src/share/demo/jvmti/hprof/hprof_md.h
+1
-1
src/solaris/back/linker_md.c
src/solaris/back/linker_md.c
+16
-23
src/solaris/demo/jvmti/hprof/hprof_md.c
src/solaris/demo/jvmti/hprof/hprof_md.c
+22
-28
src/windows/back/linker_md.c
src/windows/back/linker_md.c
+17
-28
src/windows/demo/jvmti/hprof/hprof_md.c
src/windows/demo/jvmti/hprof/hprof_md.c
+17
-27
未找到文件。
src/share/back/export/sys.h
浏览文件 @
843984e9
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
/* Implemented in linker_md.c */
/* Implemented in linker_md.c */
void
dbgsysBuildLibName
(
char
*
,
int
,
c
har
*
,
char
*
);
void
dbgsysBuildLibName
(
char
*
,
int
,
c
onst
char
*
,
const
char
*
);
void
*
dbgsysLoadLibrary
(
const
char
*
,
char
*
err_buf
,
int
err_buflen
);
void
*
dbgsysLoadLibrary
(
const
char
*
,
char
*
err_buf
,
int
err_buflen
);
void
dbgsysUnloadLibrary
(
void
*
);
void
dbgsysUnloadLibrary
(
void
*
);
void
*
dbgsysFindLibraryEntry
(
void
*
,
const
char
*
);
void
*
dbgsysFindLibraryEntry
(
void
*
,
const
char
*
);
...
...
src/share/back/transport.c
浏览文件 @
843984e9
...
@@ -97,12 +97,12 @@ findTransportOnLoad(void *handle)
...
@@ -97,12 +97,12 @@ findTransportOnLoad(void *handle)
/* Load transport library (directory=="" means do system search) */
/* Load transport library (directory=="" means do system search) */
static
void
*
static
void
*
loadTransportLibrary
(
c
har
*
libdir
,
char
*
name
)
loadTransportLibrary
(
c
onst
char
*
libdir
,
const
char
*
name
)
{
{
void
*
handle
;
void
*
handle
;
char
libname
[
MAXPATHLEN
+
2
];
char
libname
[
MAXPATHLEN
+
2
];
char
buf
[
MAXPATHLEN
*
2
+
100
];
char
buf
[
MAXPATHLEN
*
2
+
100
];
char
*
plibdir
;
c
onst
c
har
*
plibdir
;
/* Convert libdir from UTF-8 to platform encoding */
/* Convert libdir from UTF-8 to platform encoding */
plibdir
=
NULL
;
plibdir
=
NULL
;
...
@@ -131,12 +131,12 @@ loadTransportLibrary(char *libdir, char *name)
...
@@ -131,12 +131,12 @@ loadTransportLibrary(char *libdir, char *name)
* JDK 1.2 javai.c v1.61
* JDK 1.2 javai.c v1.61
*/
*/
static
jdwpError
static
jdwpError
loadTransport
(
char
*
name
,
jdwpTransportEnv
**
transportPtr
)
loadTransport
(
c
onst
c
har
*
name
,
jdwpTransportEnv
**
transportPtr
)
{
{
JNIEnv
*
env
;
JNIEnv
*
env
;
jdwpTransport_OnLoad_t
onLoad
;
jdwpTransport_OnLoad_t
onLoad
;
void
*
handle
;
void
*
handle
;
c
har
*
libdir
;
c
onst
char
*
libdir
;
/* Make sure library name is not empty */
/* Make sure library name is not empty */
if
(
name
==
NULL
)
{
if
(
name
==
NULL
)
{
...
...
src/share/demo/jvmti/hprof/hprof_md.h
浏览文件 @
843984e9
...
@@ -69,7 +69,7 @@ unsigned md_htonl(unsigned l);
...
@@ -69,7 +69,7 @@ unsigned md_htonl(unsigned l);
unsigned
md_ntohs
(
unsigned
short
s
);
unsigned
md_ntohs
(
unsigned
short
s
);
unsigned
md_ntohl
(
unsigned
l
);
unsigned
md_ntohl
(
unsigned
l
);
void
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
har
*
pname
,
char
*
fname
);
void
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
onst
char
*
pname
,
const
char
*
fname
);
void
*
md_load_library
(
const
char
*
name
,
char
*
err_buf
,
int
err_buflen
);
void
*
md_load_library
(
const
char
*
name
,
char
*
err_buf
,
int
err_buflen
);
void
md_unload_library
(
void
*
handle
);
void
md_unload_library
(
void
*
handle
);
void
*
md_find_library_entry
(
void
*
handle
,
const
char
*
name
);
void
*
md_find_library_entry
(
void
*
handle
,
const
char
*
name
);
...
...
src/solaris/back/linker_md.c
浏览文件 @
843984e9
...
@@ -55,34 +55,27 @@
...
@@ -55,34 +55,27 @@
#endif
#endif
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
const
char
*
paths
,
const
char
*
fname
)
{
// Based on os_solaris.cpp
char
*
path
,
*
paths_copy
,
*
next_token
;
char
*
path_sep
=
PATH_SEPARATOR
;
paths_copy
=
strdup
(
paths
);
char
*
pathname
=
(
char
*
)
pname
;
if
(
paths_copy
==
NULL
)
{
*
buffer
=
'\0'
;
return
;
while
(
strlen
(
pathname
)
>
0
)
{
}
char
*
p
=
strchr
(
pathname
,
*
path_sep
);
if
(
p
==
NULL
)
{
next_token
=
NULL
;
p
=
pathname
+
strlen
(
pathname
);
path
=
strtok_r
(
paths_copy
,
PATH_SEPARATOR
,
&
next_token
);
}
/* check for NULL path */
if
(
p
==
pathname
)
{
continue
;
}
(
void
)
snprintf
(
buffer
,
buflen
,
"%.*s/lib%s."
LIB_SUFFIX
,
(
int
)(
p
-
pathname
),
pathname
,
fname
);
while
(
path
!=
NULL
)
{
snprintf
(
buffer
,
buflen
,
"%s/lib%s."
LIB_SUFFIX
,
path
,
fname
);
if
(
access
(
buffer
,
F_OK
)
==
0
)
{
if
(
access
(
buffer
,
F_OK
)
==
0
)
{
break
;
break
;
}
}
if
(
*
p
==
'\0'
)
{
pathname
=
p
;
}
else
{
pathname
=
p
+
1
;
}
*
buffer
=
'\0'
;
*
buffer
=
'\0'
;
path
=
strtok_r
(
NULL
,
PATH_SEPARATOR
,
&
next_token
);
}
}
free
(
paths_copy
);
}
}
/*
/*
...
@@ -103,7 +96,7 @@ dbgsysBuildFunName(char *name, int nameLen, int args_size, int encodingIndex)
...
@@ -103,7 +96,7 @@ dbgsysBuildFunName(char *name, int nameLen, int args_size, int encodingIndex)
* appropriate pre and extensions to a filename and the path
* appropriate pre and extensions to a filename and the path
*/
*/
void
void
dbgsysBuildLibName
(
char
*
holder
,
int
holderlen
,
c
har
*
pname
,
char
*
fname
)
dbgsysBuildLibName
(
char
*
holder
,
int
holderlen
,
c
onst
char
*
pname
,
const
char
*
fname
)
{
{
const
int
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
const
int
pnamelen
=
pname
?
strlen
(
pname
)
:
0
;
...
...
src/solaris/demo/jvmti/hprof/hprof_md.c
浏览文件 @
843984e9
...
@@ -381,38 +381,32 @@ md_ntohl(unsigned l)
...
@@ -381,38 +381,32 @@ md_ntohl(unsigned l)
}
}
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
const
char
*
paths
,
const
char
*
fname
)
{
// Loosely based on os_solaris.cpp
char
*
path
,
*
paths_copy
,
*
next_token
;
char
*
pathname
=
(
char
*
)
pname
;
paths_copy
=
strdup
(
paths
);
*
buffer
=
'\0'
;
if
(
paths_copy
==
NULL
)
{
while
(
strlen
(
pathname
)
>
0
)
{
return
;
char
*
p
=
strchr
(
pathname
,
':'
);
}
if
(
p
==
NULL
)
{
p
=
pathname
+
strlen
(
pathname
);
next_token
=
NULL
;
}
path
=
strtok_r
(
paths_copy
,
":"
,
&
next_token
);
/* check for NULL path */
if
(
p
==
pathname
)
{
while
(
path
!=
NULL
)
{
continue
;
snprintf
(
buffer
,
buflen
,
"%s/lib%s"
JNI_LIB_SUFFIX
,
path
,
fname
);
}
if
(
access
(
buffer
,
F_OK
)
==
0
)
{
(
void
)
snprintf
(
buffer
,
buflen
,
"%.*s/lib%s"
JNI_LIB_SUFFIX
,
break
;
(
int
)(
p
-
pathname
),
pathname
,
fname
);
}
*
buffer
=
'\0'
;
if
(
access
(
buffer
,
F_OK
)
==
0
)
{
path
=
strtok_r
(
NULL
,
":"
,
&
next_token
);
break
;
}
}
if
(
*
p
==
'\0'
)
{
free
(
paths_copy
);
pathname
=
p
;
}
else
{
pathname
=
p
+
1
;
}
*
buffer
=
'\0'
;
}
}
}
/* Create the actual fill filename for a dynamic library. */
/* Create the actual fill filename for a dynamic library. */
void
void
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
har
*
pname
,
char
*
fname
)
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
onst
char
*
pname
,
const
char
*
fname
)
{
{
int
pnamelen
;
int
pnamelen
;
...
...
src/windows/back/linker_md.c
浏览文件 @
843984e9
...
@@ -39,38 +39,27 @@
...
@@ -39,38 +39,27 @@
#include "path_md.h"
#include "path_md.h"
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
const
char
*
paths
,
const
char
*
fname
)
{
// Based on os_windows.cpp
char
*
path
,
*
paths_copy
,
*
next_token
;
char
*
path_sep
=
PATH_SEPARATOR
;
paths_copy
=
strdup
(
paths
);
char
*
pathname
=
(
char
*
)
pname
;
if
(
paths_copy
==
NULL
)
{
*
buffer
=
'\0'
;
return
;
while
(
strlen
(
pathname
)
>
0
)
{
}
char
*
p
=
strchr
(
pathname
,
*
path_sep
);
if
(
p
==
NULL
)
{
next_token
=
NULL
;
p
=
pathname
+
strlen
(
pathname
);
path
=
strtok_s
(
paths_copy
,
PATH_SEPARATOR
,
&
next_token
);
}
/* check for NULL path */
while
(
path
!=
NULL
)
{
if
(
p
==
pathname
)
{
_snprintf
(
buffer
,
buflen
,
"%s
\\
%s.dll"
,
path
,
fname
);
continue
;
}
if
(
*
(
p
-
1
)
==
':'
||
*
(
p
-
1
)
==
'\\'
)
{
(
void
)
_snprintf
(
buffer
,
buflen
,
"%.*s%s.dll"
,
(
int
)(
p
-
pathname
),
pathname
,
fname
);
}
else
{
(
void
)
_snprintf
(
buffer
,
buflen
,
"%.*s
\\
%s.dll"
,
(
int
)(
p
-
pathname
),
pathname
,
fname
);
}
if
(
_access
(
buffer
,
0
)
==
0
)
{
if
(
_access
(
buffer
,
0
)
==
0
)
{
break
;
break
;
}
}
if
(
*
p
==
'\0'
)
{
pathname
=
p
;
}
else
{
pathname
=
p
+
1
;
}
*
buffer
=
'\0'
;
*
buffer
=
'\0'
;
path
=
strtok_s
(
NULL
,
PATH_SEPARATOR
,
&
next_token
);
}
}
free
(
paths_copy
);
}
}
/*
/*
...
@@ -113,7 +102,7 @@ dbgsysGetLastErrorString(char *buf, int len)
...
@@ -113,7 +102,7 @@ dbgsysGetLastErrorString(char *buf, int len)
* Build a machine dependent library name out of a path and file name.
* Build a machine dependent library name out of a path and file name.
*/
*/
void
void
dbgsysBuildLibName
(
char
*
holder
,
int
holderlen
,
c
har
*
pname
,
char
*
fname
)
dbgsysBuildLibName
(
char
*
holder
,
int
holderlen
,
c
onst
char
*
pname
,
const
char
*
fname
)
{
{
const
int
pnamelen
=
pname
?
(
int
)
strlen
(
pname
)
:
0
;
const
int
pnamelen
=
pname
?
(
int
)
strlen
(
pname
)
:
0
;
...
...
src/windows/demo/jvmti/hprof/hprof_md.c
浏览文件 @
843984e9
...
@@ -368,42 +368,32 @@ get_last_error_string(char *buf, int len)
...
@@ -368,42 +368,32 @@ get_last_error_string(char *buf, int len)
}
}
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
static
void
dll_build_name
(
char
*
buffer
,
size_t
buflen
,
const
char
*
pname
,
const
char
*
fname
)
{
const
char
*
paths
,
const
char
*
fname
)
{
// Loosley based on os_windows.cpp
char
*
path
,
*
paths_copy
,
*
next_token
;
char
*
pathname
=
(
char
*
)
pname
;
paths_copy
=
strdup
(
paths
);
*
buffer
=
'\0'
;
if
(
paths_copy
==
NULL
)
{
while
(
strlen
(
pathname
)
>
0
)
{
return
;
char
*
p
=
strchr
(
pathname
,
';'
);
}
if
(
p
==
NULL
)
{
p
=
pathname
+
strlen
(
pathname
);
next_token
=
NULL
;
}
path
=
strtok_s
(
paths_copy
,
";"
,
&
next_token
);
/* check for NULL path */
if
(
p
==
pathname
)
{
while
(
path
!=
NULL
)
{
continue
;
_snprintf
(
buffer
,
buflen
,
"%s
\\
%s.dll"
,
path
,
fname
);
}
if
(
*
(
p
-
1
)
==
':'
||
*
(
p
-
1
)
==
'\\'
)
{
(
void
)
_snprintf
(
buffer
,
buflen
,
"%.*s%s.dll"
,
(
int
)(
p
-
pathname
),
pathname
,
fname
);
}
else
{
(
void
)
_snprintf
(
buffer
,
buflen
,
"%.*s
\\
%s.dll"
,
(
int
)(
p
-
pathname
),
pathname
,
fname
);
}
if
(
_access
(
buffer
,
0
)
==
0
)
{
if
(
_access
(
buffer
,
0
)
==
0
)
{
break
;
break
;
}
}
if
(
*
p
==
'\0'
)
{
pathname
=
p
;
}
else
{
pathname
=
p
+
1
;
}
*
buffer
=
'\0'
;
*
buffer
=
'\0'
;
path
=
strtok_s
(
NULL
,
";"
,
&
next_token
);
}
}
free
(
paths_copy
);
}
}
/* Build a machine dependent library name out of a path and file name. */
/* Build a machine dependent library name out of a path and file name. */
void
void
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
har
*
pname
,
char
*
fname
)
md_build_library_name
(
char
*
holder
,
int
holderlen
,
c
onst
char
*
pname
,
const
char
*
fname
)
{
{
int
pnamelen
;
int
pnamelen
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录