United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6728025 LinkResolver is missing some ResourceMarks
JDK-6728025 : LinkResolver is missing some ResourceMarks

Details
Type:
Bug
Submit Date:
2008-07-21
Status:
Closed
Updated Date:
2011-07-29
Project Name:
JDK
Resolved Date:
2011-05-16
Component:
hotspot
OS:
windows
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs11
Fixed Versions:
hs21 (b12)

Related Reports
Backport:
Relates:

Sub Tasks

Description
Problem Description    : fastdebug JVM fails with
#  Internal Error (C:\BUILD_AREA\jdk6_10\hotspot\src\share\vm\memory\resourceArea.hpp:59), pid=2640, tid=2240
#  Error: memory leak: allocating without ResourceMark


JDK Release / Build     : 6u10, 7
HS Release / Build      : hs11, hs13
Bits                    : fastdebug
VM flavors              : client | server
VM Modes                : -Xmixed (didn't try with others)
Java flags              :
Platform(s)             : windows-i586 (didn't try on others)

Suite Name              : runThese/jck

                                    

Comments
EVALUATION

Problem has existed since 1.6 GA. The LinkResolver class is missing ResourceMarks in a number of error handling branches.
                                     
2011-05-05
SUGGESTED FIX

# HG changeset patch
# User jcoomes
# Date 1304607065 25200
# Node ID acf5e660c71a6845b789f85e8d2a8babdac829ed
# Parent  75af3e8de182a1d0784b15c18e3edf54e5f56185
6728025: LinkResolver is missing some ResourceMarks
Reviewed-by: dholmes, coleenp, ysr, kamg

diff -r 75af3e8de182 -r acf5e660c71a src/share/vm/interpreter/linkResolver.cpp
--- a/src/share/vm/interpreter/linkResolver.cpp	Thu May 05 09:15:52 2011 -0400
+++ b/src/share/vm/interpreter/linkResolver.cpp	Thu May 05 07:51:05 2011 -0700
@@ -327,6 +327,7 @@
 
   // 1. check if klass is not interface
   if (resolved_klass->is_interface()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected", Klass::cast(resolved_klass())->external_name());
     THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
@@ -413,6 +414,7 @@
 
  // check if klass is interface
   if (!resolved_klass->is_interface()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Found class %s, but interface was expected", Klass::cast(resolved_klass())->external_name());
     THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
@@ -534,6 +536,7 @@
 
   // check for errors
   if (is_static != fd.is_static()) {
+    ResourceMark rm(THREAD);
     char msg[200];
     jio_snprintf(msg, sizeof(msg), "Expected %s field %s.%s", is_static ? "static" : "non-static", Klass::cast(resolved_klass())->external_name(), fd.name()->as_C_string());
     THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), msg);
@@ -631,6 +634,7 @@
 
   // check if static
   if (!resolved_method->is_static()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Expected static method %s", methodOopDesc::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
                                                       resolved_method->name(),
@@ -671,6 +675,7 @@
 
   // check if not static
   if (resolved_method->is_static()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf),
                  "Expecting non-static method %s",
@@ -717,6 +722,7 @@
 
   // check if not static
   if (sel_method->is_static()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", methodOopDesc::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
                                                                                                              resolved_method->name(),
@@ -757,6 +763,7 @@
 
   // check if not static
   if (resolved_method->is_static()) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Expecting non-static method %s", methodOopDesc::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
                                                                                                              resolved_method->name(),
@@ -873,6 +880,7 @@
 
   // check if receiver klass implements the resolved interface
   if (!recv_klass->is_subtype_of(resolved_klass())) {
+    ResourceMark rm(THREAD);
     char buf[200];
     jio_snprintf(buf, sizeof(buf), "Class %s does not implement the requested interface %s",
                  (Klass::cast(recv_klass()))->external_name(),
                                     
2011-05-05
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/acf5e660c71a
                                     
2011-05-05



Hardware and Software, Engineered to Work Together