This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Diagnostic for ABI version mismatch
- From: Andrew Haley <aph at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Cc: Matthias Klose <doko at cs dot tu-berlin dot de>
- Date: Wed, 24 Jan 2007 16:04:51 +0000
- Subject: 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