# HG changeset patch # User KUBOTA Yuji # Date 1516860625 -32400 # Node ID 3e17313de75c77d02f216e17cd56dd7dc35dc44a # Parent 07a69089c84052e0651bbe2bc75bc8d3726e9c9d Bug 3513: Move test cases for race-conditions to another repository Reviewed-by: yasuenag https://github.com/HeapStats/heapstats/pull/130 diff -r 07a69089c840 -r 3e17313de75c ChangeLog --- a/ChangeLog Tue Jan 23 23:22:34 2018 +0900 +++ b/ChangeLog Thu Jan 25 15:10:25 2018 +0900 @@ -1,3 +1,7 @@ +2017-01-25 KUBOTA Yuji + + * Bug 3513: Move test cases for race-conditions to another repository + 2017-01-23 KUBOTA Yuji * Bug 3512: Drop SSE3 instruction set supporting diff -r 07a69089c840 -r 3e17313de75c agent/test/Dockerfile --- a/agent/test/Dockerfile Tue Jan 23 23:22:34 2018 +0900 +++ b/agent/test/Dockerfile Thu Jan 25 15:10:25 2018 +0900 @@ -16,6 +16,7 @@ ant \ binutils-devel \ gcc-c++ \ + tbb-devel \ # If you want to test with old jdk, use below # java-1.6.0-openjdk-devel java-1.7.0-openjdk-devel \ java-1.8.0-openjdk-devel \ @@ -44,10 +45,11 @@ WORKDIR ${HEAPSTATS_PATH}/agent/test/gtest RUN dnf install -y \ gtest-devel \ - gdb \ - && make + gdb +#RUN make WORKDIR ${HEAPSTATS_PATH}/agent/test +RUN git clone https://github.com/HeapStats/race-condition.git RUN useradd testuser \ && chown -R testuser.testuser ./* USER testuser diff -r 07a69089c840 -r 3e17313de75c agent/test/Dockerfile.el7 --- a/agent/test/Dockerfile.el7 Tue Jan 23 23:22:34 2018 +0900 +++ b/agent/test/Dockerfile.el7 Thu Jan 25 15:10:25 2018 +0900 @@ -16,6 +16,7 @@ ant \ binutils-devel \ gcc-c++ \ + tbb-devel \ # If you want to test with old jdk, use below # java-1.6.0-openjdk-devel java-1.7.0-openjdk-devel \ java-1.8.0-openjdk-devel \ @@ -46,6 +47,7 @@ # Prepare to test HeapStats WORKDIR ${HEAPSTATS_PATH}/agent/test +RUN git clone https://github.com/HeapStats/race-condition.git RUN yum install -y \ python-devel \ texinfo \ diff -r 07a69089c840 -r 3e17313de75c agent/test/README.md --- a/agent/test/README.md Tue Jan 23 23:22:34 2018 +0900 +++ b/agent/test/README.md Thu Jan 25 15:10:25 2018 +0900 @@ -1,6 +1,7 @@ # Test for HeapStats Test cases for HeapStats. These test cases could run on containers. +A race-condition testing has been moved another repository([HeapStats/race-condition](https://github.com/HeapStats/race-condition)) ## Usage diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ClassPrepare/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare/test.py --- a/agent/test/race-condition/ClassPrepare/ClassPrepare/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnClassPrepare", Cond_OnClassPrepare, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/ClassPrepare/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - -public class Test implements Runnable{ - - public void run(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - (new Thread(new Test())).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/ClassPrepare/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ClassPrepare/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnClassPrepare", Cond_OnClassPrepare, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/testcase --- a/agent/test/race-condition/ClassPrepare/ClassPrepare_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ClassPrepare/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/DataDumpRequest/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/DataDumpRequest/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH="$JAVA_HOME/lib/tools.jar:testcase" -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac -cp $CLASSPATH $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac -cp $CLASSPATH $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/DataDumpRequest/test.py --- a/agent/test/race-condition/ClassPrepare/DataDumpRequest/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -class BreakAtDataDump(gdb.Breakpoint): - def __init__(self): - super(BreakAtDataDump, self).__init__("data_dump") - - def stop(self): - gdb.execute("set var ReduceSignalUsage=true") - gdb.write("set true to ReduceSignalUsage\n") - - -class BreakAtShouldPostDataDump(gdb.Breakpoint): - def __init__(self): - super(BreakAtShouldPostDataDump, self).__init__("JvmtiExport::should_post_data_dump") - - def stop(self): - gdb.execute("set var ReduceSignalUsage=false") - gdb.write("set false to ReduceSignalUsage\n") - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnDataDumpRequestForSnapShot", common.return_true, True) -BreakAtDataDump() -BreakAtShouldPostDataDump() diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/DataDumpRequest/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/DataDumpRequest/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.stream.*; -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import com.sun.tools.attach.*; -import sun.tools.attach.*; - -public class Test implements Runnable{ - - public void run(){ - try{ - String cp = Stream.of(System.getProperty("java.class.path").split(":")) - .filter(p -> !p.contains("tools.jar")) - .findAny() - .get(); - ClassLoader loader = new URLClassLoader(new URL[]{Paths.get(cp, "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - - Path selfProc = Paths.get("/proc/self"); - String pid = Files.readSymbolicLink(selfProc).toString(); - HotSpotVirtualMachine selfVM = - (HotSpotVirtualMachine)VirtualMachine.attach(pid); - try{ - selfVM.localDataDump(); - } - finally{ - selfVM.detach(); - } - - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/DataDumpRequest/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/DataDumpRequest/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/GCWatcher/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher/test.py --- a/agent/test/race-condition/ClassPrepare/GCWatcher/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/GCWatcher/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/GCWatcher/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/testcase --- a/agent/test/race-condition/ClassPrepare/GCWatcher_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted/test.py --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runClassLoad)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/testcase --- a/agent/test/race-condition/ClassPrepare/MemoryExhausted_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEnter/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEnter/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEnter/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEnter/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEnter/test.py --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEnter/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnMonitorContendedEnterForThreadRecording", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEnter/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEnter/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test implements Runnable{ - - public void run(){ - try{ - synchronized(Test.class){ - System.out.println("Sleep at " + Thread.currentThread().getName()); - Thread.sleep(3000); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - (new Thread(new Test())).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEnter/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEnter/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEntered/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEntered/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEntered/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEntered/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEntered/test.py --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEntered/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnMonitorContendedEnteredForThreadRecording", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEntered/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEntered/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test implements Runnable{ - - public void run(){ - try{ - synchronized(Test.class){ - System.out.println("Sleep at " + Thread.currentThread().getName()); - Thread.sleep(3000); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - (new Thread(new Test())).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorContendedEntered/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/MonitorContendedEntered/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWait/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MonitorWait/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWait/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/MonitorWait/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWait/test.py --- a/agent/test/race-condition/ClassPrepare/MonitorWait/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnMonitorWait", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWait/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/MonitorWait/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test implements Runnable{ - - public void run(){ - try{ - synchronized(Test.class){ - Test.class.wait(1000); - } - } - catch(IllegalArgumentException | - IllegalMonitorStateException | InterruptedException e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWait/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/MonitorWait/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWaited/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/MonitorWaited/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWaited/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/MonitorWaited/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWaited/test.py --- a/agent/test/race-condition/ClassPrepare/MonitorWaited/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnMonitorWaited", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWaited/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/MonitorWaited/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test implements Runnable{ - - public void run(){ - try{ - synchronized(Test.class){ - Test.class.wait(1000); - } - } - catch(IllegalArgumentException | - IllegalMonitorStateException | InterruptedException e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - (new Thread(new Test())).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/MonitorWaited/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/MonitorWaited/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor/test.py --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/testcase --- a/agent/test/race-condition/ClassPrepare/SnapShotProcessor_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadEnd/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ThreadEnd/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadEnd/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/ThreadEnd/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadEnd/test.py --- a/agent/test/race-condition/ClassPrepare/ThreadEnd/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnThreadEnd", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadEnd/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/ThreadEnd/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - (new Thread(() -> System.out.println("from new thread"))).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadEnd/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/ThreadEnd/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - -ulimit -Su 500 - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted/test.py --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runClassLoad)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ThreadExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnResourceExhausted", common.return_true, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void consumeMemory(){ - while(true){ - System.gc(); - try{ - Thread.sleep(1000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runClassLoad)).start(); - (new Thread(Test::runThreadleak)).start(); - - /* Avoid PythonException not to create native thread for executing jcmd */ - Thread th = new Thread(Test::consumeMemory); - th.setDaemon(true); - th.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/ThreadExhausted_safepoint/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadStart/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/ThreadStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-threadrecorder.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadStart/heapstats-threadrecorder.conf --- a/agent/test/race-condition/ClassPrepare/ThreadStart/heapstats-threadrecorder.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -# HeapStats 2.0.trunk -# HeapStats 2.0.trunk configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -# This feature is experimental. It might be a cause of HotSpot internal error -# when you set this flag to true. -check_deadlock=false - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=true -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats_thread-records.htr -#thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=false -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadStart/test.py --- a/agent/test/race-condition/ClassPrepare/ThreadStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnThreadStart", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadStart/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/ThreadStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - (new Thread(() -> System.out.println("from new thread"))).start(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/ThreadStart/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/ThreadStart/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/VMDeath/buildenv.sh --- a/agent/test/race-condition/ClassPrepare/VMDeath/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/VMDeath/test.py --- a/agent/test/race-condition/ClassPrepare/VMDeath/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnClassPrepare", Cond_OnClassPrepare, "OnVMDeath", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/VMDeath/testcase/Test.java --- a/agent/test/race-condition/ClassPrepare/VMDeath/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args){ - Thread th = new Thread(Test::runClassLoad); - th.setDaemon(true); - th.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ClassPrepare/VMDeath/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ClassPrepare/VMDeath/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/CMSRemark/buildenv.sh --- a/agent/test/race-condition/GCWatcher/CMSRemark/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/CMSRemark/test.py --- a/agent/test/race-condition/GCWatcher/CMSRemark/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "VM_CMS_Final_Remark::doit", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/CMSRemark/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/CMSRemark/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/G1Cleanup/buildenv.sh --- a/agent/test/race-condition/GCWatcher/G1Cleanup/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/G1Cleanup/test.py --- a/agent/test/race-condition/GCWatcher/G1Cleanup/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "callbackForG1Cleanup", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/G1Cleanup/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/G1Cleanup/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted/buildenv.sh --- a/agent/test/race-condition/GCWatcher/MemoryExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted/test.py --- a/agent/test/race-condition/GCWatcher/MemoryExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/MemoryExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runGC(){ - try{ - while(true){ - System.gc(); - Thread.sleep(100); - } - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args){ - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - gcThread.start(); - (new Thread(Test::runMemleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time, threading -sys.path.append(os.pardir + "/../") - -import common - -# Kick GC after occurring GC. -def Kick_GC(): - threading.Thread(target=os.system, args=("jcmd 0 GC.run",)).start() - return True - - -common.initialize("OnResourceExhausted", Kick_GC, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/MemoryExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare/buildenv.sh --- a/agent/test/race-condition/GCWatcher/OnClassPrepare/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare/test.py --- a/agent/test/race-condition/GCWatcher/OnClassPrepare/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/OnClassPrepare/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/GCWatcher/OnClassPrepare/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/buildenv.sh --- a/agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../OnClassPrepare/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/test.py --- a/agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/testcase --- a/agent/test/race-condition/GCWatcher/OnClassPrepare_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../OnClassPrepare/testcase/ \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParNewGCStart/buildenv.sh --- a/agent/test/race-condition/GCWatcher/ParNewGCStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmn10m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParNewGCStart/test.py --- a/agent/test/race-condition/GCWatcher/ParNewGCStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "VM_GenCollectForAllocation::doit", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParNewGCStart/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/ParNewGCStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.*; - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - - List list = new ArrayList<>(); - for(int i = 1; i < 10; i++){ - list.add(new byte[1024 * 1024]); // 1MB - } - - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/buildenv.sh --- a/agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseParallelGC -XX:-UseParallelOldGC" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/test.py --- a/agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnGarbageCollectionStart", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/ParallelGarbageCollectionStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/buildenv.sh --- a/agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:-UseParallelOldGC" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/test.py --- a/agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnGarbageCollectionStart", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/ParallelOldGarbageCollectionStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor/buildenv.sh --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor/test.py --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 sec to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/buildenv.sh --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/test.py --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, True, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/testcase --- a/agent/test/race-condition/GCWatcher/SnapShotProcessor_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted/buildenv.sh --- a/agent/test/race-condition/GCWatcher/ThreadExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted/test.py --- a/agent/test/race-condition/GCWatcher/ThreadExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/ThreadExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - System.gc(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ThreadExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, True, True, True, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/GCWatcher/ThreadExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(10000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - (new Thread(Test::runGC)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare/test.py --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runClassLoad)).start(); - (new Thread(Test::runMemleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ClassPrepare/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/testcase --- a/agent/test/race-condition/MemoryExhausted/ClassPrepare_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ClassPrepare/testcase/ \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/GCWatcher/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher/test.py --- a/agent/test/race-condition/MemoryExhausted/GCWatcher/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/GCWatcher/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runGC(){ - while(true){ - try{ - System.gc(); - Thread.sleep(100); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - Thread memleakThread = new Thread(Test::runMemleak); - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - - gcThread.start(); - memleakThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time, threading -sys.path.append(os.pardir + "/../") - -import common - -# Kick GC after occurring GC. -def Kick_GC(): - threading.Thread(target=os.system, args=("jcmd 0 GC.run",)).start() - return True - -common.initialize("OnResourceExhausted", Kick_GC, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/GCWatcher_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted/test.py --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runMemleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/testcase --- a/agent/test/race-condition/MemoryExhausted/MemoryExhausted_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor/test.py --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runGC(){ - while(true){ - try{ - System.gc(); - Thread.sleep(100); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - Thread memleakThread = new Thread(Test::runMemleak); - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - - gcThread.start(); - memleakThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/testcase --- a/agent/test/race-condition/MemoryExhausted/SnapShotProcessor_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted/test.py --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common -import re - -# from jvmti.h -JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002 -JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004 - -def flagToInt(): - m = re.search("\d+$", gdb.execute("p flags", False, True)) - return int(m.group(0)) - -def Cond_MemoryExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP) != 0) - -def Cond_ThreadExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) - -common.initialize("OnResourceExhausted", Cond_MemoryExhausted, "OnResourceExhausted", Cond_ThreadExhausted, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ThreadExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common -import re - -# from jvmti.h -JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002 -JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004 - -def flagToInt(): - m = re.search("\d+$", gdb.execute("p flags", False, True)) - return int(m.group(0)) - -def Cond_MemoryExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP) != 0) - -def Cond_ThreadExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) - -common.initialize("OnResourceExhausted", Cond_MemoryExhausted, "OnResourceExhausted", Cond_ThreadExhausted, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/MemoryExhausted/ThreadExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(1000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runGC)).start(); - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-deadlock.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# heapstats_agent 2.0.0 -# heapstats_agent 2.0.0 configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -check_deadlock=true - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=false -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats-thread-records.htr -thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=true -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/test.py --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEnter", common.return_true, "dldetector::OnMonitorContendedEnter", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/testcase/Test.java --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2017 Yasumasa Suenaga - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -public class Test implements Runnable{ - - private final Object lock1; - private final Object lock2; - - public Test(Object lock1, Object lock2){ - this.lock1 = lock1; - this.lock2 = lock2; - } - - public void run(){ - try{ - synchronized(lock1){ - Thread.sleep(3000); - synchronized(lock2){ - System.out.println("Test error"); - System.exit(-1); - } - } - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - Object lock1 = new Object(); - Object lock2 = new Object(); - - Thread th1 = new Thread(new Test(lock1, lock2)); - Thread th2 = new Thread(new Test(lock2, lock1)); - th1.setDaemon(true); - th2.setDaemon(true); - th1.start(); - th2.start(); - - Thread.sleep(7000); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/heapstats-deadlock.conf \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/test.py --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEnter", common.return_true, "dldetector::OnMonitorContendedEnter", common.return_true, False, at_safepoint=True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/testcase --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEnter_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-deadlock.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# heapstats_agent 2.0.0 -# heapstats_agent 2.0.0 configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -check_deadlock=true - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=false -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats-thread-records.htr -thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=true -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/test.py --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEnter", common.return_true, "dldetector::OnMonitorContendedEntered", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/testcase/Test.java --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 Yasumasa Suenaga - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -public class Test implements Runnable{ - - private final Object lock; - - public Test(Object lock){ - this.lock = lock; - } - - public void run(){ - try{ - synchronized(lock){ - Thread.sleep(3000); - } - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - Object lock1 = new Object(); - Object lock2 = new Object(); - - Thread th1 = new Thread(new Test(lock1)); - Thread th2 = new Thread(new Test(lock1)); - th1.start(); - th2.start(); - - Thread th3 = new Thread(new Test(lock2)); - Thread th4 = new Thread(new Test(lock2)); - - th3.start(); - th4.start(); - - th1.join(); - th2.join(); - th3.join(); - th4.join(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/heapstats-deadlock.conf \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/test.py --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEnter", common.return_true, "dldetector::OnMonitorContendedEntered", common.return_true, True, at_safepoint=True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/testcase --- a/agent/test/race-condition/MonitorContendedEnter/MonitorContendedEntered_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-deadlock.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# heapstats_agent 2.0.0 -# heapstats_agent 2.0.0 configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -check_deadlock=true - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=false -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats-thread-records.htr -thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=true -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/test.py --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEntered", common.return_true, "dldetector::OnMonitorContendedEnter", common.return_true, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/testcase/Test.java --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 Yasumasa Suenaga - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -public class Test implements Runnable{ - - private final Object lock; - - public Test(Object lock){ - this.lock = lock; - } - - public void run(){ - try{ - synchronized(lock){ - Thread.sleep(3000); - } - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - Object lock1 = new Object(); - Object lock2 = new Object(); - - Thread th1 = new Thread(new Test(lock1)); - Thread th2 = new Thread(new Test(lock1)); - th1.start(); - th2.start(); - - Thread th3 = new Thread(new Test(lock2)); - Thread th4 = new Thread(new Test(lock2)); - - th3.start(); - th4.start(); - - th1.join(); - th2.join(); - th3.join(); - th4.join(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/heapstats-deadlock.conf \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/test.py --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEntered", common.return_true, "dldetector::OnMonitorContendedEnter", common.return_true, True, at_safepoint=True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/testcase --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEnter_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEnter/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -export HEAPSTATS_CONF=heapstats-deadlock.conf - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -# heapstats_agent 2.0.0 -# heapstats_agent 2.0.0 configuration file. -attach=true - -# Output file setting -file=heapstats_snapshot.dat -heaplogfile=heapstats_log.csv -archivefile=heapstats_analyze.zip -logfile= -loglevel=INFO -reduce_snapshot=true - -# SnapShot type -collect_reftree=true - -# Trigger snapshot setting -trigger_on_fullgc=true -trigger_on_dump=true - -# deadlock check -check_deadlock=true - -# Trigger logging setting -trigger_on_logerror=true -trigger_on_logsignal=true -trigger_on_loglock=true - -# Rank setting -rank_level=5 -rank_order=delta - -# Alert setting -alert_percentage=50 - -# Alert threshold for java heap usage. -# "0" means disabled. -javaheap_alert_percentage=95 - -# Alert threshold for metaspace usage (in MB). -# "0" means disabled. -metaspace_alert_threshold=0 - -# Timer setting -snapshot_interval=0 -log_interval=300 - -first_collect=true -logsignal_normal= -logsignal_all=SIGUSR2 -signal_reload=SIGHUP - -# Thread recording -thread_record_enable=false -thread_record_buffer_size=100 # Set buffer size in MB. -thread_record_filename=heapstats-thread-records.htr -thread_record_iotracer=/usr/local/etc/iotracer/IoTrace.class - -# Snmp setting -snmp_send=true -snmp_target=localhost -snmp_comname=public -# You can check library path with `net-snmp-config --netsnmp-libs` -snmp_libpath=/usr/lib64/libnetsnmp.so - -logdir=./tmp -archive_command=/usr/bin/zip %archivefile% -jr %logdir% - -kill_on_error=false diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/test.py --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEntered", common.return_true, "dldetector::OnMonitorContendedEntered", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/testcase/Test.java --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2017 Yasumasa Suenaga - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - - -public class Test implements Runnable{ - - private final Object lock; - - public Test(Object lock){ - this.lock = lock; - } - - public void run(){ - try{ - synchronized(lock){ - Thread.sleep(3000); - } - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception{ - Object lock1 = new Object(); - Object lock2 = new Object(); - - Thread th1 = new Thread(new Test(lock1)); - Thread th2 = new Thread(new Test(lock1)); - th1.start(); - th2.start(); - - Thread th3 = new Thread(new Test(lock2)); - Thread th4 = new Thread(new Test(lock2)); - - th3.start(); - th4.start(); - - th1.join(); - th2.join(); - th3.join(); - th4.join(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/buildenv.sh --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/heapstats-deadlock.conf --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/heapstats-deadlock.conf Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/heapstats-deadlock.conf \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/test.py --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Yasumasa Suenaga - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("dldetector::OnMonitorContendedEntered", common.return_true, "dldetector::OnMonitorContendedEntered", common.return_true, False, at_safepoint=True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/testcase --- a/agent/test/race-condition/MonitorContendedEntered/MonitorContendedEntered_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MonitorContendedEntered/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/README.md --- a/agent/test/race-condition/README.md Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -# Test cases for testing race condition - -## Usage - -1. Add directories to `testlist.txt` -2. Run `testcase.sh` - -## How to add new tase cases for testing race condition. - -1. Create a directory. -2. Create a `buildenv.sh` to set environment for testing. -3. Write `test.py` and testcase such like as existing test codes. - -### `buildenv.sh` - -`buildenv.sh` requires the following. - -* `CLASSPATH` - * Classpath to build test code. - * Should write an absolute path. -* `MAINCLASS` - * A main class of test code. -* `JAVA_OPTS` - * Options for launching java process. -* `HEAPSTATS_CONF` - * Path to `heapstats.conf` for testing -* Command line to build test code. - -### `test.py` - -* Import `common.py` on parent directory -* Use `common.initialize()` method with passing break point names and break condition as arguments - -### Result - -* `test.py` will touch `test-succeeded` when the test passed correctly. Otherwise, will touch `test-failed`. -* `testcase.sh` will show a summary of all test cases's result at last as below. - -``` -Test summary: - Testcase1: succeeded - Testcase2: succeeded - Testcase3: failed - : -``` - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/CMSRemark/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/CMSRemark/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/CMSRemark/test.py --- a/agent/test/race-condition/SnapShotProcessor/CMSRemark/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "VM_CMS_Final_Remark::doit", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/CMSRemark/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/CMSRemark/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - Thread.sleep(10000); // Sleep 10 secs again to avoid missing... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/G1Cleanup/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/G1Cleanup/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/G1Cleanup/test.py --- a/agent/test/race-condition/SnapShotProcessor/G1Cleanup/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "callbackForG1Cleanup", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/G1Cleanup/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/G1Cleanup/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher/test.py --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 sec to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/test.py --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/testcase --- a/agent/test/race-condition/SnapShotProcessor/GCWatcher_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted/test.py --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/testcase --- a/agent/test/race-condition/SnapShotProcessor/MemoryExhausted_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/testcase/ \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare/test.py --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../OnClassPrepare/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/test.py --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, False, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/testcase --- a/agent/test/race-condition/SnapShotProcessor/OnClassPrepare_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../OnClassPrepare/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParNewGCStart/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/ParNewGCStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmn10m -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParNewGCStart/test.py --- a/agent/test/race-condition/SnapShotProcessor/ParNewGCStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "VM_GenCollectForAllocation::doit", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParNewGCStart/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/ParNewGCStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.util.*; - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - - List list = new ArrayList<>(); - for(int i = 1; i < 10; i++){ - list.add(new byte[1024 * 1024]); // 1MB - } - - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:+UseParallelGC -XX:-UseParallelOldGC" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/test.py --- a/agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnGarbageCollectionStart", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/ParallelGarbageCollectionStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-XX:-UseParallelOldGC" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/test.py --- a/agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnGarbageCollectionStart", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/ParallelOldGarbageCollectionStart/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void main(String[] args) throws Exception{ - System.gc(); - Thread.sleep(3000); // Sleep 3 secs to wait breakpoint... - System.gc(); - } - -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted/test.py --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - System.gc(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ThreadExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, "OnResourceExhausted", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/SnapShotProcessor/ThreadExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(10000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - (new Thread(Test::runGC)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/GCWatcher/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher/test.py --- a/agent/test/race-condition/ThreadExhausted/GCWatcher/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/GCWatcher/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - try{ - System.gc(); - Thread.sleep(100); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - Thread threadleakThread = new Thread(Test::runThreadleak); - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - - gcThread.start(); - threadleakThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../GCWatcher/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - - -common.initialize("OnResourceExhausted", common.return_true, "TGCWatcher::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/GCWatcher_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(10000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - (new Thread(Test::runGC)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted/test.py --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common -import re - -# from jvmti.h -JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002 -JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004 - -def flagToInt(): - m = re.search("\d+$", gdb.execute("p flags", False, True)) - return int(m.group(0)) - -def Cond_MemoryExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP) != 0) - -def Cond_ThreadExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) - -common.initialize("OnResourceExhausted", Cond_ThreadExhausted, "OnResourceExhausted", Cond_MemoryExhausted, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../MemoryExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common -import re - -# from jvmti.h -JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002 -JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004 - -def flagToInt(): - m = re.search("\d+$", gdb.execute("p flags", False, True)) - return int(m.group(0)) - -def Cond_MemoryExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP) != 0) - -def Cond_ThreadExhausted(): - return ((flagToInt() & JVMTI_RESOURCE_EXHAUSTED_THREADS) != 0) - -common.initialize("OnResourceExhausted", Cond_ThreadExhausted, "OnResourceExhausted", Cond_MemoryExhausted, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/MemoryExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runMemleak(){ - List list = new ArrayList<>(); - - while(true){ - list.add(new byte[1024*1024]); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(1000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runMemleak)).start(); - (new Thread(Test::runThreadleak)).start(); - - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - gcThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -unset JAVA_OPTS -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/dynload/DynLoad.java - -ulimit -Su 500 - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare/test.py --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runClassLoad)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../OnClassPrepare/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -def Cond_OnClassPrepare(): - gdb.newest_frame().older().select() - symbol = gdb.execute("p (char *)klass->_name->_body", False, True) - return (symbol.find("DynLoad") != -1) - - -common.initialize("OnResourceExhausted", common.return_true, "OnClassPrepare", Cond_OnClassPrepare, True, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; - - -public class Test{ - - public static void runClassLoad(){ - try{ - ClassLoader loader = new URLClassLoader(new URL[]{ - Paths.get(System.getProperty("java.class.path"), "dynload") - .toUri() - .toURL()}); - Class target = loader.loadClass("DynLoad"); - Method targetMethod = target.getMethod("call"); - Object targetObj = target.newInstance(); - targetMethod.invoke(targetObj); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(1000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runClassLoad)).start(); - (new Thread(Test::runThreadleak)).start(); - - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - gcThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/testcase/dynload/DynLoad.java --- a/agent/test/race-condition/ThreadExhausted/OnClassPrepare_safepoint/testcase/dynload/DynLoad.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -public class DynLoad{ - public void call(){ - System.out.println("from " + Thread.currentThread().getName()); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor/test.py --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - try{ - System.gc(); - Thread.sleep(100); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - Thread threadleakThread = new Thread(Test::runThreadleak); - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - - gcThread.start(); - threadleakThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "TSnapShotProcessor::entryPoint:RACE_COND_DEBUG_POINT", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/testcase --- a/agent/test/race-condition/ThreadExhausted/SnapShotProcessor_safepoint/testcase Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../SnapShotProcessor/testcase \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -export CLASSPATH=testcase -export MAINCLASS=Test -export JAVA_OPTS="-Xmx500m" -unset HEAPSTATS_CONF - -$JAVA_HOME/bin/javac $TEST_TARGET/testcase/Test.java - -ulimit -Su 500 diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted/test.py --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - (new Thread(Test::runThreadleak)).start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/buildenv.sh --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/buildenv.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -../ThreadExhausted/buildenv.sh \ No newline at end of file diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/test.py --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/test.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import sys, os, time -sys.path.append(os.pardir + "/../") - -import common - -common.initialize("OnResourceExhausted", common.return_true, "OnResourceExhausted", common.return_true, False, at_safepoint=True, jcmd_for_safepoint=False) diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/testcase/Test.java --- a/agent/test/race-condition/ThreadExhausted/ThreadExhausted_safepoint/testcase/Test.java Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/* - * Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import java.net.*; -import java.nio.file.*; -import java.lang.reflect.*; -import java.util.*; - - -public class Test{ - - public static void runThreadleak(){ - Runnable waiter = () -> { - try{ - synchronized(Test.class){ - Test.class.wait(); - } - } - catch(InterruptedException e){ - e.printStackTrace(); - } - }; - - while(true){ - try{ - (new Thread(waiter)).start(); - } - catch(Throwable t){ - t.printStackTrace(); - System.exit(-1); - } - } - } - - public static void runGC(){ - while(true){ - System.gc(); - try{ - Thread.sleep(1000); - } - catch(Exception e){ - e.printStackTrace(); - } - } - } - - public static void main(String[] args){ - (new Thread(Test::runThreadleak)).start(); - (new Thread(Test::runThreadleak)).start(); - - Thread gcThread = new Thread(Test::runGC); - gcThread.setDaemon(true); - gcThread.start(); - } -} diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/common.py --- a/agent/test/race-condition/common.py Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -''' -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -''' - -import gdb, threading, os - -class ContinueInvoker: - def __init__(self, th): - self.__thread_num = th - - def __call__(self): - gdb.execute("thread " + str(self.__thread_num)) - gdb.execute("continue") - - -class BreakPointHandler(gdb.Breakpoint): - def __init__(self, bp, condition): - super(BreakPointHandler, self).__init__(bp) - self.__cond = condition - self.thread_num = -1 - - def stop(self): - if(self.__cond()): - self.thread_num = gdb.selected_thread().num - self.enabled = False - gdb.write("Suspend thread #" + str(self.thread_num) + "\n") - return True - else: - return False - - -class SafepointBreaker(gdb.Breakpoint): - def __init__(self, rcgen): - super(SafepointBreaker, self).__init__("Interpreter::notice_safepoints") - self.at_safepoint = False - self.__rcgen = rcgen - - def stop(self): - self.at_safepoint = True - self.enabled = False - self.__rcgen.coordinate() - return False - - -class RaceConditionGenerator: - def __init__(self, primary, secondary, secondary_enabled, need_safepoint, is_reverse, jcmd_for_safepoint): - self.__primary = primary - self.__secondary = secondary - self.__secondary_enabled = secondary_enabled - self.__need_safepoint = need_safepoint - self.__safepoint_breaker = None - self.__is_reverse = is_reverse - self.__jcmd_for_safepoint = jcmd_for_safepoint - - def coordinate(self): - if((not self.__secondary_enabled) and (not self.__primary.enabled) and (self.__secondary.thread_num == -1)): - self.__secondary.enabled = True - elif((self.__primary.thread_num != -1) and (self.__secondary.thread_num != -1)): - if self.__need_safepoint: - if self.__safepoint_breaker is None: - self.__safepoint_breaker = SafepointBreaker(self) - if self.__jcmd_for_safepoint: - threading.Thread(target=os.system, args=("jcmd 0 GC.run",)).start() - return - elif not self.__safepoint_breaker.at_safepoint: - return - - gdb.write("Test start!\n") - gdb.execute("p SafepointSynchronize::_state") - - if self.__is_reverse: - gdb.post_event(ContinueInvoker(self.__secondary.thread_num)) - gdb.post_event(ContinueInvoker(self.__primary.thread_num)) - else: - gdb.post_event(ContinueInvoker(self.__primary.thread_num)) - gdb.post_event(ContinueInvoker(self.__secondary.thread_num)) - - -def is_stopped(): - result = True - for thread in gdb.selected_inferior().threads(): - result &= thread.is_stopped() - return result - -class StopHandler: - def __init__(self, rcgen): - self.__rcgen = rcgen - self.__is_abort = False - - def __call__(self, event): - # Ignore signals - if isinstance(event, gdb.SignalEvent): - if(event.stop_signal == "SIGABRT"): - self.__is_abort = True - gdb.write("Stop all threads...\n") - gdb.execute("interrupt -a") - else: - gdb.post_event(ContinueInvoker(event.inferior_thread.num)) - elif isinstance(event, gdb.BreakpointEvent): - self.__rcgen.coordinate() - elif(self.__is_abort and is_stopped()): - self.__is_abort = False - gdb.write("Dumping core...\n") - gdb.execute("gcore") - gdb.execute("quit") - - -def return_true(): - return True - - -def exit_handler(event): - gdb.execute("quit") - - -def initialize(primary, primary_cond, secondary, secondary_cond, secondary_enabled, is_reverse=False, at_safepoint=False, jcmd_for_safepoint=True): - gdb.execute("set confirm off") - gdb.execute("set breakpoint pending on") - gdb.execute("set target-async on") - gdb.execute("set pagination off") - gdb.execute("set non-stop on") - - p = BreakPointHandler(primary, primary_cond) - s = BreakPointHandler(secondary, secondary_cond) - s.enabled = secondary_enabled - rcgen = RaceConditionGenerator(p, s, secondary_enabled, at_safepoint, is_reverse, jcmd_for_safepoint) - - gdb.events.stop.connect(StopHandler(rcgen)) - gdb.events.exited.connect(exit_handler) - diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/testcase.sh --- a/agent/test/race-condition/testcase.sh Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -<< LICENSE -Copyright (C) 2017 Nippon Telegraph and Telephone Corporation - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program 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 for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -LICENSE - -#!/bin/sh - -pushd $(dirname $0) >/dev/null - -if [[ $1 == "--clean" ]]; then - find . \( -name "*.class" -o -name "core*" -o -name "hs_err*log" -o -name "*.gdb" -o -name "*.log" -o -name command.gdb -o -name "heapstats_*" -o -name "test-failed" -o -name "test-succeeded" -o -name "tmp*" -o -name core \) -exec rm -fR {} \; - rm -fR __pycache__ - exit -fi - -declare -A DEFAULT_ULIMITS - -function store_ulimits(){ - for item in `ulimit -a | sed -e 's/^.\+\(-.\))\s\+\(.\+\)$/\1,\2/g'`; do - key=`echo $item | cut -d',' -f 1` - value=`echo $item | cut -d',' -f 2` - DEFAULT_ULIMITS[$key]=$value - done -} - -function restore_ulimits(){ - for key in ${!DEFAULT_ULIMITS[@]}; do - ulimit -S $key ${DEFAULT_ULIMITS[$key]} > /dev/null 2>&1 - done -} - - -if [ -z "$JAVA_HOME" ]; then - echo '$JAVA_HOME is not set.' - exit 1 -fi; - -if [ -z "$HEAPSTATS_LIB" ]; then - echo '$HEAPSTATS_LIB is not set.' - exit 2 -fi; - -TESTLIST=${1:-$PWD/testlist.txt} - -if [ ! -e $TESTLIST ]; then - echo "$TESTLIST does not exist." - exit 3 -fi - -ulimit -c unlimited -store_ulimits - -for TEST_ENTRY in `cat $TESTLIST`; do - for TESTDIR in `ls -d $TEST_ENTRY`; do - echo "Run $TESTDIR" - - export TEST_TARGET=$PWD/$TESTDIR - source $TEST_TARGET/buildenv.sh - - AGENTPATH="-agentpath:$HEAPSTATS_LIB" - - if [ -n "$HEAPSTATS_CONF" ]; then - AGENTPATH="$AGENTPATH=$HEAPSTATS_CONF" - fi - - cat < $TEST_TARGET/command.gdb -set logging file result.log -set logging on -run $AGENTPATH $JAVA_OPTS $MAINCLASS >> result.log 2>&1 -EOF - # If select specified gdb, load files and symbols to exec - if [ -n "$GDB_PATH" ] ; then - cat < $TEST_TARGET/loadfiles.gdb -set sysroot / -set debug-file-directory /usr/lib/debug -set directories /usr/src/debug -set use-deprecated-index-sections on -EOF - JAVA_LIB=$(find ${JAVA_HOME%/}/ -name "java" -type f | grep -v jre) - echo "file ${JAVA_LIB}" >> ${TEST_TARGET}/loadfiles.gdb - JAVA_LIB=${JAVA_LIB%/bin/java} - echo "set solib-search-path /lib64/:${JAVA_LIB}:${JAVA_LIB}*/jre/lib/amd64/:${JAVA_LIB}*/jre/lib/amd64/*/:${HEAPSTATS_LIB%/*}" >> ${TEST_TARGET}/loadfiles.gdb - - pushd $TEST_TARGET - ${GDB_PATH}/bin/gdb -q -x loadfiles.gdb -x test.py -x command.gdb - else - pushd $TEST_TARGET - gdb -q -x test.py -x command.gdb $JAVA_HOME/bin/java - fi - - if [ $? -ne 0 ]; then - echo "$TESTDIR failed!" - touch test-failed - else - ls hs_err*.log > /dev/null 2>&1 - - if [ $? -eq 0 ]; then - echo "$TESTDIR failed! (hs_err exists)" - touch test-failed - else - ls core* > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "$TESTDIR failed! (core exists)" - touch test-failed - else - echo "$TESTDIR succeeded" - touch test-succeeded - fi - fi - - fi - - restore_ulimits - popd - done -done - -echo -echo "Test summary:" - -for TESTDIR in `cat $TESTLIST`; do - echo -n " $TESTDIR: " - - if [ -e $TESTDIR/test-succeeded ]; then - echo -e "\e[32msucceeded\e[m" - elif [ -e $TESTDIR/test-failed ]; then - echo -e "\e[31mfailed\e[m" - else - echo -e "\e[33munknown\e[m" - fi - -done - -popd >/dev/null diff -r 07a69089c840 -r 3e17313de75c agent/test/race-condition/testlist.txt --- a/agent/test/race-condition/testlist.txt Tue Jan 23 23:22:34 2018 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -ClassPrepare/* -MemoryExhausted/* -ThreadExhausted/* -SnapShotProcessor/* -GCWatcher/* -MonitorContendedEnter/* -MonitorContendedEntered/*