caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: skaller@users.sourceforge.net
Cc: angela.zhu@cs.rice.edu, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] How to prevent program from crashing
Date: Wed, 31 Oct 2007 16:47:27 +0900 (JST)	[thread overview]
Message-ID: <20071031.164727.246512997.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <1193813647.8355.57.camel@rosella.wigram>

From: skaller <skaller@users.sourceforge.net>
> > Following is the message I got after the crashing:
> > 
> > 
> > ************************************************************************ 
> > ************************
> > (acumen:4063): Gtk-CRITICAL **: _gtk_text_line_char_locate: assertion  
> > `char_offs
> > et >= 0' failed
> > 
> > Gtk-ERROR **: Char offset -1 is off the end of the line
> > aborting...
> > Abort trap
> 
> Yeah, this is an abort from a failed assertion in C,
> so it isn't an Ocaml exception.
> 
> I don't know how GTK handles this, that is, whether there is
> a way to register an error handler. You should ask
> Jacques Garrigue that.. hmmm. no I'll post this to the list
> because this is quite an interesting issue.
> 
> It would appear that this line in your code, which calls the
> GTK binding:
> 
>  let appp = program2#buffer#get_text()
> 
> is the source of the problem, and that would be a bug in the Ocaml
> library, not your code. Even if the buffer is empty, at least Ocaml
> the library should handle this.

If this is intended as a bug report, this is a poor one indeed.
We need at least the version numbers for both Gtk and LablGTK2, and
the actual code...

As it is, buffer#get_text () seems to work perfectly with empty
buffers, with the latest version of LablGTK2, and Gtk-2.6.10.

Independently of that, text iterators can be very tricky to use
manually. LablGTK attempts at catching errors, but Gtk sometimes
crashes after the exception is caught... So better to be sure to make
no error.

Jacques Garrigue


  parent reply	other threads:[~2007-10-31  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-31  4:29 Angela Zhu
2007-10-31  5:08 ` [Caml-list] " skaller
     [not found]   ` <ED53732F-0753-4F6C-B424-A24714CBC8F7@cs.rice.edu>
2007-10-31  6:54     ` skaller
2007-10-31  7:13       ` Angela Zhu
2007-10-31  7:47       ` Jacques Garrigue [this message]
2007-10-31  9:31         ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071031.164727.246512997.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=angela.zhu@cs.rice.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).