Delivered-To: garrigue at math.nagoya-u.ac.jp Authentication-Results: mailhost.math.nagoya-u.ac.jp sender=lablgtk-bounces at yquem.inria.fr; domainkey=neutral (no query protocol specified; no policy for yquem.inria.fr) Delivered-To: Lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=NKEir2hJKj11tS9AwrYfVYRkmyk825i7KinrZHgUCYI=; b=vjbYKIizZGLQgRNld+s+HyxknKBzIfW0B2WusHD6Rhz68yFEhEi6P8J2N4v1x3IA8z tcDX7Yjh8K7WkB7ctgJs9HW1O0OQCYwCghQw+imWdjEiJZfMAU7jTYW40zXkgqdTwePK r0tqr1wpIKum2Pda4fvzwhB+qcxz897wetVno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=rf4Qe+y6MDAQKv9nsP9UYwyC+8TRDcao1McasnM4XvVB36gZKV7gv9Nmptt39E2bpy h0+i/4kY07+DLwbUqAFXLbNgA8AEUgyhH89H5BmqVudKQ9pQXFDZoZhKukqxMSwPYFMM qaz2TJU9ONacktdXPLTRGJ3lBD3IO/MpyAHmg= Date: Tue, 14 Sep 2010 18:53:04 -0500 From: Peter Groves To: Peter Groves Subject: Re: [Lablgtk] segfault when reattaching a tree model to a tree view Message-Id: <20100914185304.67bedad5.pdgroves at gmail.com> In-Reply-To: <20100914154914.9a890dc1.pdgroves at gmail.com> References: <20100913205658.026ac951.pdgroves at gmail.com> <20100914154914.9a890dc1.pdgroves@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Lablgtk at yquem.inria.fr Status: U The newest development is that the segfault is avoided if the treeview is not displayed in a scrolled_window. However, there are several hundred rows to be displayed, so this isn't a long term option. Also, when it's not in the scrolled_window, the entire user interface is much much slower (I assume because all rows are being displayed, even if they are off screen). So now I'm considering just trying to find another way to display this table, which will probably just mean implementing my own less-pretty but more stable version of treeview. On Tue, 14 Sep 2010 15:49:14 -0500 Peter Groves wrote: > Jacques, >=20 > Thanks for offering to take a look. I'm sorry it's such a complicated > piece of code. I've attached the module. Here's the quick explanation > of what's going on: >=20 > - the data to be displayed is in a structure called a > TacticScoreTable.t > - makeTreeModel() populates a GTree.list_store with the data, plus a > boolean column to indicate if the row in the table is 'selected' > - makeTreeView() creates a GTree.view of the list_store, with the > 'selected' column viewed as an editable check box > - setSelectedTacticsByMask() sets all the boolean values to true or > false based on a bitmask. this is where the segfault occurs when I try > to add calls to treeView#set_model to detach and reattach the > treeModel. >=20 > In this version of the code, I actually try reattaching the model > before editing any data in the model, and it crashes there. That is, > in this code the "updating model info" log message is never reached.=20 >=20 > I noticed that when the view_columns are created, they take a > reference to the model columns. This would seem to cause an > inconsistency if I attached a new model. Am I suppose to be rebuilding > the view_columns each time I call set_model with a Some(x) value? >=20 > I'm now going to try to isolate the bug further if possible. Thanks > for any help. >=20 > Peter >=20 > p.s. The crash occurs both on Ubuntu Intrepid Ibex and Lucid Lynx > (10.04). Lablgtk versions listed in my apt repositories are 2.10.1-2 > and 2.14.0 +dfsg-2build1, respectively. >=20 >=20 > On Tue, 14 Sep 2010 16:36:12 +0900 > Jacques Garrigue wrote: >=20 > > Dear Peter, > >=20 > > I tried to do the same kind of thing with the tree_model.ml example, > > and I don't see any segmentation fault when setting the model again. > > Can you show some code. > > Also the version numbers of lablgtk and gtk, and the platform used, > > would be useful. > >=20 > > Jacques > >=20 > > On Tue, Sep 14, 2010 at 10:56 AM, Peter Groves > > wrote: > > > Hi, > > > > > > I'm trying to speed up a tree view using the hints in the tutorial > > > found here: > > > > > > http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/treeview-tutorial/ch03s0= 3.html#sec-treestore-adding-many-rows > > > > > > My problem is slightly different than the one described in the > > > tutorial, however. I'm not replacing rows in the table but just > > > changing the values in a single column. The column is booleans in > > > the model and "cell_renderer_toggle" in the view, which basically > > > means that one of the columns in the table contains a checkbox for > > > every row. The slow performance occurs when I try to set the > > > values of all the checkboxes in a batch. I have also tried > > > disabling sorting, but that did not seem to make any difference. > > > > > > So now I'm trying to detach the model from the view while I do the > > > batch update, then reattach them. I'm able to detach the model > > > from the view using: > > > > > > =A0- self.treeView#set_model None; > > > > > > =A0- Then I update the model by using an 'iter' over all the rows in > > > the model. > > > > > > =A0- Finally, I try to replace the model with: > > > =A0 =A0self.treeView#set_model (Some(self.treeModel#coerce)); > > > > > > It segFaults on the last step. Are there any suggestions for what > > > might be going wrong or any way to debug this? > > > > > > Thanks, > > > Peter > > > > > > _______________________________________________ > > > Lablgtk mailing list > > > Lablgtk@yquem.inria.fr > > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk > > > >=20 _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk