This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Diagnostic for ABI version mismatch


If we get a hard ABI mismatch, print out an error message and abort.
This can only result from an improperly installed system, but at least
we get some kind of diagnostic.

Andrew.


2007-01-24  Andrew Haley  <aph@redhat.com>

	* prims.cc (_Jv_Abort): fflush (stderr).
	* java/lang/natClassLoader.cc (_Jv_CheckABIVersion): Abort.

Index: prims.cc
===================================================================
--- prims.cc	(revision 121108)
+++ prims.cc	(working copy)
@@ -457,6 +457,7 @@
 #else
   fprintf (stderr, "libgcj failure: %s\n", message);
 #endif
+  fflush (stderr);
   abort ();
 }
 
Index: java/lang/natClassLoader.cc
===================================================================
--- java/lang/natClassLoader.cc	(revision 121108)
+++ java/lang/natClassLoader.cc	(working copy)
@@ -208,6 +208,12 @@
       // C++ ABI
       if (version == GCJ_CXX_ABI_VERSION)
 	return;
+
+      // If we've loaded a library that uses the C++ ABI, and this
+      // library is an incompatible version, then we're dead.  There's
+      // no point throwing an exception: that will crash.
+      JvFail ("gcj linkage error.\n"
+	      "Incorrect library ABI version detected.  Aborting.\n");
     }
 
   throw new ::java::lang::ClassFormatError


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