[java-gnome-hackers] Duplicating assertion `GDK_IS_WINDOW (window)' failed crash
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2010-12-20 13:05:51
|
I still don't have any insight into what's going on with https://bugzilla.gnome.org/show_bug.cgi?id=637132#c2 but I have come up with three useful diagnostics: 1) manually print a message when an object gets finalized We have a fair bit of printf infrastructure for debugging memory management; in this case I think all you really need is a message when a GObject Proxy is getting finalized: === modified file 'src/bindings/org/gnome/glib/Object.java' --- src/bindings/org/gnome/glib/Object.java 2010-01-06 05:24:40 +0000 +++ src/bindings/org/gnome/glib/Object.java 2010-12-20 10:59:56 +0000 @@ -111,7 +111,7 @@ * continue to exist quite happily.</i> */ protected final void release() { - if (Debug.MEMORY_MANAGEMENT) { + if (true) { System.err.println("Object.release()\t\t" + this.toString()); System.err.flush(); } 2) ensure WARNINGs in finalizer thread aren't missed out on Since exceptions thrown in finalizers are suppressed, we're missing out on the errors occurring during from GC. It is almost tempting to call ExceptionDescribe() here, although if we did that you'd see two stack traces for any normal (heh) CRITICAL. === modified file 'src/jni/bindings_java_util.c' --- src/jni/bindings_java_util.c 2010-01-06 07:07:08 +0000 +++ src/jni/bindings_java_util.c 2010-12-20 11:25:56 +0000 @@ -396,6 +396,9 @@ msg = g_strdup_printf("%s-%s\n%s", log_domain, level, message); + g_printerr("DANGER %s\n", msg); + fflush(stderr); + bindings_java_throwByName(env, "org/gnome/glib/FatalError", msg); g_free(msg); 3) do crazy amounts of GC I wrote up a thread to do nothing but invoke the garbage collector ... frequently. :) === modified file 'src/quill/ui/UserInterface.java' --- src/quill/ui/UserInterface.java 2010-11-05 13:05:45 +0000 +++ src/quill/ui/UserInterface.java 2010-12-20 12:59:19 +0000 @@ -68,7 +68,25 @@ } private void setupWindows() { + final Thread t; + primaries = new HashSet<PrimaryWindow>(3); + + t = new Thread() { + public void run() { + while (true) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + System.gc(); + } + }; + }; + t.setDaemon(true); + t.start(); } hahah... Anyway, the result is that instead of it taking a whole lot of operations and 10s of minutes of typing, with Quill I can trigger the crash *immediately*. Just press Ins and try and insert a segment. AfC Sydney |