Re: Think I found another bug in gtk.




Daniel Flemming said:
On Mon, 23 Aug 2004, Jan Hudec wrote:
Yes, the demo reports the same errors here. Though it seems to run.

Mm-hm, that's right. If you have a $SIG{__WARN__} handler that ignores
error messages, this bug fails to show up entirely. It's weird; everything
in the chooser works fine, but you get a Critical error.

the "assertion `...' failed" messages are created by g_return_if_fail(), a C
macro used to guard against programming errors at runtime.  they are flagged
as "critical" because it is possible (in theory) to turn them off in a
performance build, which means that they probably would result in crashes. 
the assertion message stuff is used rather than calling abort() to allow your
app to continue to run when such a condition comes up.  (then again, there's
also g_error() with *does* call abort()...)

using a $SIG{__WARN__} handler that ignores warnings will suppress the
messages, yes, but it's a very bad idea.  the presence of these assertions
means there is a bug, and just making the messages go away doesn't make the
bug go away ;-).  we route the glib log messages through warn() so that the
message will pick up the nearest perl line number, since you often wind up
triggering them with bad perl code; the fact that you can suppress them is a
"side effect".  if the bug is in gtk+ itself (which it appears to be), there's
nothing we can (or should) do at the binding level.


-- 
muppet <scott at asofyet dot org>



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