classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: Full stacktrace on glib/gtk errors and warnings


From: Thomas Fitzsimmons
Subject: Re: [cp-patches] RFC: Full stacktrace on glib/gtk errors and warnings
Date: Mon, 27 Jun 2005 12:48:12 -0400

On Sat, 2005-06-25 at 15:51 +0200, Mark Wielaard wrote:
> Hi,
> 
> While working with the native gtk+ awt peers I often need to find out
> where precisely a warning or error message is comming from. The
> following patch installs a default log handler that dumps a stacktrace
> whenever we encounter such a situation. It is careful about only
> installing it when gtk+ (> 2.4) supports it and that it isn't swallowing
> any pending exceptions.
> 
> 2005-06-25  Mark Wielaard  <address@hidden>
> 
>         * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
>         (glog_func): New static function.
>         (Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Install glog_func as
>         default log handler.
>         * native/jni/gtk-peer/Makefile.am (libgtkpeer_la_LIBADD): Add jcl.
> 
> This generates things like:
> 
> java.lang.InternalError: GdkPixbuf: gdk_pixbuf_loader_close: assertion 
> `priv->closed == FALSE' failed
>    at gnu.java.awt.peer.gtk.GdkPixbufDecoder.finish (Native Method)
>    at gnu.java.awt.peer.gtk.GdkPixbufDecoder.finalize 
> (GdkPixbufDecoder.java:182)
> 
> (Which indeed is a bug that I recently introduces, sorry. We should be
> more careful in the finalizer manipulating the native state.)
> 
> The stack trace generation is only conditional on it being something
> that already generates output on stderr by default. Since I think that
> none of these error/warning messages should ever occur in our code (it
> means we are feeding the native side bogus data from java-'user-space')
> I think this is the right thing to do. And it really helps with
> debugging.
> 
> Comments?

This looks good.  Thanks!

Tom

> 
> Cheers,
> 
> Mark
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches





reply via email to

[Prev in Thread] Current Thread [Next in Thread]