This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc-2.2.5 bug triggered by Java interpreter


Hi,

On Wed, 2002-10-02 at 22:25, Tom Tromey wrote:
> 
> Anyway, it seems reasonable to me for us to chop off the class name at
> the `$' before passing it to dlopen.  This gives a little less
> flexibility in naming the .so, but I don't think this loss is very
> important.  Any comments on this idea?

The attached patch (untested) does this.
Other ideas are to also turn the '$' into a '-' or to only allow the .so
for a complete package (until now I didn't even know you could also do
it on the class level).

But whatever we decide we should at least document it somewhere. I
looked but couldn't find this in the gcj manual. Is it documented
somewhere else?

Cheers,

Mark

-- 
No.
> Should I include quotations after my reply?
Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.51
diff -u -u -r1.51 natClassLoader.cc
--- java/lang/natClassLoader.cc	30 Sep 2002 05:19:09 -0000	1.51
+++ java/lang/natClassLoader.cc	4 Oct 2002 14:09:59 -0000
@@ -204,7 +204,14 @@
       // by `lib-gnu-pkg.so' and `lib-gnu.so'.  If loading one of
       // these causes the class to appear in the cache, then use it.
       java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-"));
-      jstring so_base_name = (sb->append (name)->toString ())->replace ('.', '-');
+      // Skip inner classes
+      jstring cn;
+      jint ci = name->indexOf('$');
+      if (ci == -1)
+	cn = name;
+      else
+	cn = name->substring (0, ci);
+      jstring so_base_name = (sb->append (cn)->toString ())->replace ('.', '-');
 
       // Compare against `3' because that is the length of "lib".
       while (! klass && so_base_name && so_base_name->length() > 3)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]