FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dynDUI delay

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Mon May 30, 2005 9:09 am    Post subject: dynDUI delay Reply with quote

Debuging the new dynDUI shows to be more problematic than expected.

Seems that structs created by the D code and passed to Gtk+ (TreeIter) are collected by the D GC - as expected but that should be be a problem also on the old DUI version and it isn't(?).
The problem gets more interesting because the structs can be used i.e.
the tree can be browsed. We get into problems only when the tree is refreshed by removing all nodes.
This problem manifests on leds code outline view - but not on all source files.

Just to let you know what's going on...

Antonio
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Mon May 30, 2005 10:19 am    Post subject: Reply with quote

Very, strange! I hope it's not too difficult to fix.

Good to know, though. Is that the last remaining issue?

-JJR
Back to top
View user's profile Send private message
popatr



Joined: 20 May 2005
Posts: 3

PostPosted: Wed Jun 01, 2005 11:23 am    Post subject: Reply with quote

I'm no d expert by any stretch, but I know that d classes can have custom garbage collection behavior. I.e., you can specify that a class not be garbage collected... in which case you need to manage the memory yourself. There's some piece of code on digital mars which shows this.

So, if garbage collection is the problem, this may be the solution.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Jun 01, 2005 11:53 am    Post subject: Re: dynDUI delay Reply with quote

Ant wrote:
Seems that structs created by the D code and passed to Gtk+ (TreeIter) are collected by the D GC - as expected but that should be be a problem also on the old DUI version and it isn't(?).


It might have been a problem with the old version, but we likely never noticed it. Remember that leds was not near as far along on windows as before. And on linux, access violations/segmentation faults don't occur in the same situations as on win32.

Quote:
The problem gets more interesting because the structs can be used i.e.
the tree can be browsed. We get into problems only when the tree is refreshed by removing all nodes.
This problem manifests on leds code outline view - but not on all source files.


Are you working with windows or linux? So it's the tree view that's still causing problems?

-JJR
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Jun 01, 2005 12:07 pm    Post subject: Re: dynDUI delay Reply with quote

JJR wrote:

Are you working with windows or linux? So it's the tree view that's still causing problems?

-JJR


I'm on linux.
I made some updates to the svn.
Try to fire leds (go to preferences and set code browser to display, restart leds) and open the DUI.def.types, it will segfault (but maybe you need to open another source file after the types).

I think the problem is that the treeNodes are linked on the Gtk+ C code but not on the D side so the GC collects the tree nodes.
Adding a root to the GC might fix that - I believe I did that on the base widget but the treeNode (i.e. TreeIter) is not a widget.

I have to try it.

Ant
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Jun 01, 2005 12:13 pm    Post subject: Reply with quote

Ouch! That's a very subtle issue. I would not have found the source of that bug. I haven't dealt with the GC on that level before.

I hope that's the source of the problem.

I'll try compiling.

-JJR
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Jun 01, 2005 12:49 pm    Post subject: Reply with quote

JJR wrote:
Ouch! That's a very subtle issue. I would not have found the source of that bug. I haven't dealt with the GC on that level before.

I hope that's the source of the problem.

I'll try compiling.

-JJR


Well, maybe it's not the TreeIter because the TreeIter is not a presistent object.
But I believe I might be something like that, more testing is required... :(

I did step throught the Gtk+ code and it segfaults when refering to sibeling nodes of the base node to be removed.
I still don't understand why this doesn't happend on the old version. Somethimes adding a gc.fullCollect helps spotting these problems.

Ant
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Jun 01, 2005 2:05 pm    Post subject: Reply with quote

Were all updates to the original DUI ported over to dynDUI?

I know it wasn't completely up to date when I was working on it. Maybe we missed something?

-JJR
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Jun 01, 2005 3:13 pm    Post subject: Reply with quote

JJR wrote:
Were all updates to the original DUI ported over to dynDUI?

I know it wasn't completely up to date when I was working on it. Maybe we missed something?

-JJR

Not all, just the ones that seem relevant.

Ant
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group