author | never |
Mon, 12 Jul 2010 22:27:18 -0700 | |
changeset 5926 | a36f90d986b6 |
parent 5506 | 202f599c92aa |
child 14786 | a9f61e0cbe61 |
permissions | -rw-r--r-- |
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
1 |
# |
5506 | 2 |
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
4 |
# |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
8 |
# |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
13 |
# accompanied this code). |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
14 |
# |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License version |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
18 |
# |
5506 | 19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
# or visit www.oracle.com if you need additional information or have any |
|
21 |
# questions. |
|
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
22 |
# |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
23 |
|
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
24 |
|
3867 | 25 |
# @test Test6842838.sh |
26 |
# @bug 6842838 |
|
27 |
# @summary Test 6842838 64-bit launcher failure due to corrupt jar |
|
28 |
# @compile CreateBadJar.java |
|
29 |
# @run shell Test6842838.sh |
|
30 |
||
31 |
set -x |
|
32 |
||
33 |
if [ "${TESTJAVA}" = "" ]; then |
|
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
34 |
PARENT=`dirname \`which java\`` |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
35 |
TESTJAVA=`dirname ${PARENT}` |
3867 | 36 |
printf "TESTJAVA not set. Test cannot execute. Failed.\n" |
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
37 |
fi |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
38 |
|
3867 | 39 |
if [ "${TESTCLASSES}" = "" ]; then |
40 |
printf "TESTCLASSES not set. Test cannot execute. Failed.\n" |
|
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
41 |
exit 1 |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
42 |
fi |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
43 |
|
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
44 |
# set platform-dependent variables |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
45 |
OS=`uname -s` |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
46 |
case "$OS" in |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
47 |
SunOS ) |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
48 |
NULL=/dev/null |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
49 |
PS=":" |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
50 |
FS="/" |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
51 |
JAVA_EXE=${TESTJAVA}${FS}bin${FS}sparcv9${FS}java |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
52 |
;; |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
53 |
* ) |
3867 | 54 |
printf "Only testing on sparcv9 (use libumem to reliably catch buffer overrun)\n" |
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
55 |
exit 0; |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
56 |
;; |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
57 |
esac |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
58 |
|
3867 | 59 |
if [ ! -x ${JAVA_EXE} ]; then |
60 |
printf "Warning: sparcv9 components not installed - skipping test.\n" |
|
61 |
exit 0 |
|
62 |
fi |
|
63 |
||
64 |
LIBUMEM=/lib/64/libumem.so |
|
65 |
if [ ! -x ${LIBUMEM} ]; then |
|
66 |
printf "Warning: libumem not installed - skipping test.\n" |
|
67 |
exit 0 |
|
68 |
fi |
|
69 |
||
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
70 |
BADFILE=newbadjar.jar |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
71 |
${JAVA_EXE} -version |
3867 | 72 |
${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF" |
73 |
LD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1 |
|
3848
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
74 |
|
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
75 |
grep "Invalid or corrupt jarfile" test.out |
2c2395fb6d85
6842838: 64-bit failure in handling invalid manifest in launcher.
kevinw
parents:
diff
changeset
|
76 |
exit $? |