Re: abort in gmessages.c



On Wed, 2003-05-21 at 11:36, Emmanuel Briot wrote:
> > g_error() is used only in cases where a fatal, unhandlable
> > error occurs.
> > 
> > If you find a place where g_error() is used for an error
> > that could be reasonably handled by an application, it's
> > worth a bug report, because we should look whether
> > we need to enhance the API in that error.
> 
> 
> Sorry, I should have provided more context.
> This occurs with errors in gtktextbuffer.c, when an invalid byte index
> is specified. For instance, we use this to highlight the contents of
> lines, and unfortunately, we currently have some bugs in there,
> resulting in invalid byte index (after the end of the line). Obviously,
> highlighting is not critical, and doing nothing in such cases would be
> better than crashing the editor, with possibly unsaved changed in it.
> 
> Obviously, we are working on fixing these bugs, but we all know how they
> tend to come back behind your back...

What we try to do in such cases is detect the problems early
enough that we can harmlessly return and leave things in
a sane state, with a g_warning() to alert the programmer
that that there is a bug they need to fix.

Can you patch GtkTextBuffer to do that in this case?

However, if the problem only is detected only later when the
state of the textbuffer is hopelessly corrupted, then the
g_error() is as good as anything ... I doubt that you'd prefer
it if the widget segfaults 100 instructions later.

Regards,
                                       Owne





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