8205687: TimeoutHandler generates huge core files
authoriignatyev
Mon, 13 Aug 2018 13:44:45 -0700
changeset 51451 79e86b32d7e2
parent 51450 da793334f142
child 51452 7bd2a286e637
8205687: TimeoutHandler generates huge core files Summary: use kill instead of gcore to generate core file Reviewed-by: dholmes
test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java
test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java
test/failure_handler/src/share/conf/linux.properties
test/failure_handler/src/share/conf/mac.properties
test/failure_handler/src/share/conf/solaris.properties
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java	Thu Aug 09 11:33:47 2018 -0700
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java	Mon Aug 13 13:44:45 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,8 @@
         Properties osProperty = Utils.getProperties(osName);
         try {
             ActionHelper helper = new ActionHelper(workdir, "config", osProperty, jdks);
-            return new ToolKit(helper, log, osName, "common");
+            // os-specific action set must be last, b/c they can kill the process
+            return new ToolKit(helper, log, "common", osName);
         } catch (InvalidValueException e) {
             throw new IllegalStateException("can't create tool kit", e);
         }
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java	Thu Aug 09 11:33:47 2018 -0700
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java	Mon Aug 13 13:44:45 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,9 +56,6 @@
         pids.add(pid);
         for (Long p = pids.poll(); p != null; p = pids.poll()) {
             HtmlSection pidSection = section.createChildren("" + p);
-            for (ActionSet set : actions) {
-                set.gatherProcessInfo(pidSection, p);
-            }
             List<Long> children = helper.getChildren(pidSection, p);
             if (!children.isEmpty()) {
                 HtmlSection s = pidSection.createChildren("children");
@@ -67,6 +64,9 @@
                 }
                 pids.addAll(children);
             }
+            for (ActionSet set : actions) {
+                set.gatherProcessInfo(pidSection, p);
+            }
         }
     }
 }
--- a/test/failure_handler/src/share/conf/linux.properties	Thu Aug 09 11:33:47 2018 -0700
+++ b/test/failure_handler/src/share/conf/linux.properties	Mon Aug 13 13:44:45 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -52,9 +52,9 @@
 native.stack.args.delimiter=\0
 native.stack.params.repeat=6
 
-native.core.app=gcore
-native.core.args=-o ./core.%p %p
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################
--- a/test/failure_handler/src/share/conf/mac.properties	Thu Aug 09 11:33:47 2018 -0700
+++ b/test/failure_handler/src/share/conf/mac.properties	Mon Aug 13 13:44:45 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -61,11 +61,9 @@
 native.stack.params.repeat=6
 native.stack.args=-c\0DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'thread backtrace all' -o 'detach' -o 'quit'
 
-native.core.app=bash
-native.core.delimiter=\0
-native.core.args=-c\0gcore -o ./core.%p %p || \
-  (DevToolsSecurity --status | grep -q enabled && lldb --batch -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit')
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################
--- a/test/failure_handler/src/share/conf/solaris.properties	Thu Aug 09 11:33:47 2018 -0700
+++ b/test/failure_handler/src/share/conf/solaris.properties	Mon Aug 13 13:44:45 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -51,9 +51,9 @@
 native.stack.args=-F %p
 native.stack.params.repeat=6
 
-native.core.app=gcore
-native.core.args=-F -o ./core %p
-native.core.params.timeout=3600000
+# has to be the last command
+native.core.app=kill
+native.core.args=-ABRT %p
 ################################################################################
 # environment info to gather
 ################################################################################