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]

[gcjx] Patch: Avoid segfaulting on not finding a JAR in the CLASSPATH


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

  While trying to bootstrap the gcjx branch, I noticed that the
compiler encounters a SIGSEGV after the diagnostic for a missing
JAR (libgcj-4.0.0.jar). What was happening was that in
gcjx::post_options (driver.cc) we set the global compiler
only at the very end, but the CLASSPATH initialisation bits
before that try to set_failed() on the compiler when a JAR
in the CLASSPATH is not found. Fixed simply by setting the
global compiler early on in post_options() as shown in the
attached patch.

OK?

The branch still does not bootstrap for me (fails while
compiling gnu/java/text/FormatCharacterIterator) and I will
separately investigate that.

Thanks,
Ranjit.

- --
Ranjit Mathew       Email: rmathew AT gmail DOT com

Bangalore, INDIA.     Web: http://ranjitmathew.hostingzero.com/




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDIu5KYb1hx2wRS48RAkWEAJ4jceazSzc2ZuNoHRBHdJ08kGoj5wCfbsSl
znS6rlW6MKDsUjKyKCKUG2k=
=0qf8
-----END PGP SIGNATURE-----
Index: ChangeLog
from  Ranjit Mathew  <rmathew@gcc.gnu.org>

	* driver.cc (gcjx::post_options): Set global compiler before
	processing elements in CLASSPATH to avoid segfaulting on diagnostics.

Index: driver.cc
===================================================================
--- driver.cc	2005-09-10 17:29:25.000000000 +0530
+++ driver.cc	2005-09-10 17:31:14.000000000 +0530
@@ -352,6 +352,8 @@ gcjx::post_options (const char **filenam
 {
   assert (*filename_ptr);
   arguments->filename = *filename_ptr;
+  
+  global->set_compiler (our_compiler);
 
   // FIXME: GCC_EXEC_PREFIX handling.
 
@@ -403,10 +405,6 @@ gcjx::post_options (const char **filenam
   else if (! flag_syntax_only)
     our_compiler->add_code_generator (new tree_code_generator (our_compiler,
 							       dircache));
-
-  // Final setup for use of compiler.
-  global->set_compiler (our_compiler);
-
   return false;
 }
 

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