Hi,

this patch removes a call to atexit from GtkToolkit. The comment didn't give sufficient detail as to why the atexit call was necessary and the failure I witnessed in the Jikes RVM was as follows:

1) VM runs some AWT code that causes the atexit routine in GtkToolkit to be registered
2) VM shuts down, stopping all of its services (GC...)
3) VM calls exit that calls atexit routines
4) gdk_threads_enter is called via atexit, this then calls JNI monitor enter in the shutdown VM

the shutdown VM can't handle the JNI call and locks up. There is an assumption in the Jikes RVM that atexit routines won't exist that call JNI functions.

Thanks,
Ian
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c      2007-04-04 
12:30:32.000000000 +0100
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c      2007-09-27 
13:48:41.000000000 +0100
@@ -182,10 +182,6 @@
 
   gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
 
-  /* Make sure queued calls don't get sent to GTK/GDK while 
-     we're shutting down. */
-  atexit (gdk_threads_enter);
-
   if ((homedir = getenv ("HOME")))
     {
       rcpath = (char *) g_malloc (strlen (homedir) + strlen (RC_FILE) + 2);

Reply via email to