Re: segfault when reattaching a tree model to a tree view

Jacques Garrigue <[email protected]> Wed, 15 Sep 2010 18:53:35 +0900
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
On Wed, Sep 15, 2010 at 5:02 PM, Peter Groves <[email protected]> wrote:
> Jacques,
>
> You're example ran fine (once i ran it properly :). I noticed (through
> brute force guess and check) that in my code I was able to work around
> the bug by changing the vpolicy on the scroll bar to `ALWAYS instead
> of `AUTOMATIC.
>
> After much trial and error to bring your example in line with my code,
> I have been able to reproduce the bug with as few changes as possible
> to your example. The code is attached. The program should crash when
> you click the 'dump' button. In the current form, you can make the bug
>  go away by either
> 1) changing the vpolicy of the scroll_window to 'ALWAYS on line 142,
> OR
> 2) you can remove the call to scrollContainer#set_resize_mode
> `IMMEDIATE; on line 140.

Removing this spurious scrollContainer seems to do the trick too.
More curiously, actually I don't get a segmentation fault, but the complete
window disappears and is restarted immediately. This is maybe the way
it is handled under windows (I happen to be testing under windows
because I was building the windows package of lablgtk2...)

> For me, the workaround of setting the vpolicy to `ALWAYS is
> acceptable. Sadly, this whole exercise has not led to a speed increase
> in the slowness I was originally trying to solve, but hopefully the
> bug report does some good.

SInce this seems to be a bug in gtk, I'm afraid I can do little about that.
With a C translation of this code, maybe I can file a bug report,
but honestly who wants to translate this kind of code to C...

For the performance, this is too bad. If the problem is specific to lablgtk,
we can try to do something, but I'm afraid this is just the utter inneficiency
of the gtk's stores.

Jacques