GNOME Bugzilla – Bug 171427
Application crashes after a DrawingArea has gotten a number of expose events
Last modified: 2009-08-15 18:40:50 UTC
Steps to reproduce: Stack trace: *** glibc detected *** ./camel: double free or corruption (fasttop): 0x09960748 *** ======= Backtrace: ========= /lib/tls/libc.so.6[0x3676e0] /lib/tls/libc.so.6(__libc_free+0x77)[0x367cb2] /usr/lib/libglib-2.0.so.0(g_free+0x22)[0x784bf4] /usr/lib/libgdk-x11-2.0.so.0(gdk_region_destroy+0x25)[0x206077] /usr/lib/libgtkjni-2.6.so(Java_org_gnu_gdk_Region_gdk_1region_1destroy+0x2c)[0x8569fc] /usr/lib/libgtkjava-2.6.so(_ZN3org3gnu3gdk6Region18gdk_region_destroyEPNS0_4glib6HandleE+0x40)[0xbbe894] /usr/lib/libgtkjava-2.6.so(_ZN3org3gnu3gdk6Region8finalizeEv+0x2d)[0xbbe8f9] /usr/lib/libgcj.so.6(_Z18_Jv_FinalizeObjectPN4java4lang6ObjectE+0x1f)[0x493e335] /usr/lib/libgcj.so.6[0x4c74235] /usr/lib/libgcj.so.6(GC_invoke_finalizers+0x7a)[0x4c7c0da] /usr/lib/libgcj.so.6(_Z17_Jv_RunFinalizersv+0x17)[0x4c74293] /usr/lib/libgcj.so.6(_ZN3gnu3gcj7runtime15FinalizerThread3runEv+0x100)[0x49335ec] /usr/lib/libgcj.so.6(_Z13_Jv_ThreadRunPN4java4lang6ThreadE+0x27)[0x4943c25] /usr/lib/libgcj.so.6[0x4c75ad6] /usr/lib/libgcj.so.6(GC_start_routine+0xbb)[0x4c866b0] /lib/tls/libpthread.so.0[0x46db17] /lib/tls/libc.so.6(__clone+0x5e)[0x3ca84e] Other information: I'm not sure how valuable the backtrace is, I dont have any special debugging flags turned on. I'm using a DrawingArea, have implemented the ExposeListener interface, the exposeEvent() method does absolutley nothing except return true. This simple test-case reveals the bug, you have make sure enough expose-events get generated before the app aborts: import org.gnu.gtk.*; import org.gnu.gtk.event.*; class TestExpose implements ExposeListener { public TestExpose() { Window window = new Window(WindowType.TOPLEVEL); DrawingArea darea = new DrawingArea(); window.add(darea); darea.addListener(this); window.showAll(); } public boolean exposeEvent(ExposeEvent event) { System.out.print("expose-event"); return true; } public static void main(String[] args) { Gtk.init(args); new TestExpose(); Gtk.main(); } }
This bug may seem hard to generate using the above example, but if you make the exposeEvent actually render some lines and stuff to the Gdk.Window, the application aborts more quickly.
Jacob, is there any possibility you could try this with a more recent version of libgtk-java ?
I'm afraid not, I'm running Fedora Rawhide, and it is using libgtk-java 2.6.1. I don't have enough time/experience maintaining a jhbuild of Gnome.
Is Rawhide == FC3? Because if so... well, the rpms for FC3 (http://people.redhat.com/fitzsim/java-gnome/i386/) don't have gtk-java 2.6... so how did you get it without doing it from CVS?
Hmmm after a little googling, it seems rawhide is like "debian sid"... gotta try running the example later when i get home...
Yes Rawhide is somewhat similar to Debian Sid, I have the latest test release FC4-test1 installed + updates from rawhide. I don't think this bug is specific to FC4-test1 though, as neither Gtk or Gtk# has this problem.
i have the exact same problem when using a drawing area i'm using libgtk-java 2.48 on gentoo i'll install 2.6 and try again it seems (atleast for me) that the crash happens when resizing smaller the window
this only happens to me when i'm using blackdown-jdk 1.4.2 with sun jdk1.4.2 it doesn't crash
crashes also with sun-jdk
*** Bug 303391 has been marked as a duplicate of this bug. ***
I have tested this with the current CVS HEAD and was not able to duplicate the error. CVS HEAD is undergoing a large amount of changes for memory management improvements. As this is probably a memory management issue, it should be resolved with the next version.
Created attachment 50174 [details] Test Case I get a similar error using CVS HEAD. Note that the app I included needs to be built with the fixes in bug 303391 built into Java-Gnome.
Sorry, I meant bug 312408 (disregard earlier bug number) :)
Thanks for reporting this bug. I was able to reproduce the bug using Adam's test case. I have identified a few problems and I have fixed them in my local copy. I will clean it up and commit these changes soon.
After several changes that have now been commited to CVS HEAD, I can't reproduce this anymore. Closing it. Please re-open if you can still see this issue.