changeset 15777:cebf22a0fa91

8161225: Assert failure in JVMTI GetNamedModule at JPLISAgent.c line: 792 Summary: Made the assert less restrictive. Reviewed-by: dholmes, dcubed, sspitsyn
author cjplummer
date Wed, 21 Sep 2016 12:53:07 -0700
parents 793b76d431f1
children 2ac37e4cbc91 a1f77096eb86
files src/java.instrument/share/native/libinstrument/JPLISAgent.c test/ProblemList.txt test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.instrument/share/native/libinstrument/JPLISAgent.c	Wed Sep 21 08:10:48 2016 -0400
+++ b/src/java.instrument/share/native/libinstrument/JPLISAgent.c	Wed Sep 21 12:53:07 2016 -0700
@@ -790,9 +790,10 @@
     pkg_name_buf[len] = '\0';
 
     err = (*jvmti)->GetNamedModule(jvmti, loaderObject, pkg_name_buf, &moduleObject);
+    free((void*)pkg_name_buf);
+    check_phase_ret_blob(err, NULL);
     jplis_assert_msg(err == JVMTI_ERROR_NONE, "error in the JVMTI GetNamedModule");
 
-    free((void*)pkg_name_buf);
     return moduleObject;
 }
 
--- a/test/ProblemList.txt	Wed Sep 21 08:10:48 2016 -0400
+++ b/test/ProblemList.txt	Wed Sep 21 12:53:07 2016 -0700
@@ -134,8 +134,6 @@
 
 java/lang/instrument/BootClassPath/BootClassPathTest.sh         8072130 macosx-all
 
-java/lang/instrument/DaemonThread/TestDaemonThread.java         8161225 generic-all
-
 java/lang/management/MemoryMXBean/Pending.java                  8158837 generic-all
 java/lang/management/MemoryMXBean/PendingAllGC.sh               8158760 generic-all
 
--- a/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java	Wed Sep 21 08:10:48 2016 -0400
+++ b/test/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java	Wed Sep 21 12:53:07 2016 -0700
@@ -1,6 +1,6 @@
 /*
  * Copyright 2014 Goldman Sachs.
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, 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
@@ -32,6 +32,7 @@
             ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-javaagent:DummyAgent.jar", "TestDaemonThread", ".");
             OutputAnalyzer analyzer = ProcessTools.executeProcess(pb);
             analyzer.shouldNotContain("ASSERTION FAILED");
+            analyzer.shouldHaveExitValue(0);
         }
     }
 }