author | duke |
Wed, 05 Jul 2017 20:01:44 +0200 | |
changeset 26660 | 5e174bbfc03a |
parent 12374 | 351cb50bd097 |
child 35594 | cc13089c6327 |
permissions | -rw-r--r-- |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
1 |
/* |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
2 |
* Copyright 2012 SAP AG. All Rights Reserved. |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
4 |
* |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
8 |
* |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
13 |
* accompanied this code). |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
14 |
* |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
18 |
* |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
21 |
* questions. |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
22 |
*/ |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
23 |
|
12374 | 24 |
public class TestPostFieldModification { |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
25 |
|
12374 | 26 |
public String value; // watch modification of value |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
27 |
|
12374 | 28 |
public static void main(String[] args){ |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
29 |
|
12374 | 30 |
System.out.println("Start threads"); |
31 |
// this thread modifies the field 'value' |
|
32 |
new Thread() { |
|
33 |
TestPostFieldModification test = new TestPostFieldModification(); |
|
34 |
public void run() { |
|
35 |
test.value="test"; |
|
36 |
for(int i = 0; i < 10; i++) { |
|
37 |
test.value += new String("_test"); |
|
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
38 |
} |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
39 |
} |
12374 | 40 |
}.start(); |
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
41 |
|
12374 | 42 |
// this thread is used to trigger a gc |
43 |
Thread d = new Thread() { |
|
44 |
public void run() { |
|
45 |
while(true) { |
|
46 |
try { |
|
47 |
Thread.sleep(100); |
|
48 |
} catch (InterruptedException e) { |
|
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
49 |
|
12374 | 50 |
} |
51 |
System.gc(); |
|
52 |
} |
|
53 |
} |
|
54 |
}; |
|
55 |
d.setDaemon(true); |
|
56 |
d.start(); |
|
12366
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
57 |
} |
76be8878c0cd
7158988: jvm crashes while debugging on x86_32 and x86_64
coleenp
parents:
diff
changeset
|
58 |
} |