www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - -v1 doesn't assume std.gc.setV1_0()

reply "Chris Miller" <chris dprogramming.com> writes:
Should -v1 assume std.gc.setV1_0()? I don't believe it does.

Some objects in some of my programs are being collected too early unless I  
call std.gc.setV1_0(). I don't believe I'm doing any pointer voodoo  
either, but it's possible.

Perhaps as a compromise, -v1 could assume std.gc.setV1_0() as long as the  
new GC isn't considered stable.
Feb 21 2007
next sibling parent reply Tyler Knott <tywebmail mailcity.com> writes:
Chris Miller wrote:
 Should -v1 assume std.gc.setV1_0()? I don't believe it does.
 
 Some objects in some of my programs are being collected too early unless 
 I call std.gc.setV1_0(). I don't believe I'm doing any pointer voodoo 
 either, but it's possible.
 
 Perhaps as a compromise, -v1 could assume std.gc.setV1_0() as long as 
 the new GC isn't considered stable.

The only change in the post-1.0 GC is that it doesn't scan numeric types for pointers (e.g. uint[]). Are you sure you're not storing the pointers/references in a numeric type somewhere? If you aren't, then try to create a test case and file a bug report at http://d.puremagic.com/issues/ The last bugs with the new GC should have been fixed in DMD 1.004/GDC 0.22.
Feb 21 2007
parent reply "Chris Miller" <chris dprogramming.com> writes:
On Wed, 21 Feb 2007 16:06:56 -0500, Tyler Knott <tywebmail mailcity.com>  
wrote:

 Chris Miller wrote:
 Should -v1 assume std.gc.setV1_0()? I don't believe it does.
  Some objects in some of my programs are being collected too early  
 unless I call std.gc.setV1_0(). I don't believe I'm doing any pointer  
 voodoo either, but it's possible.
  Perhaps as a compromise, -v1 could assume std.gc.setV1_0() as long as  
 the new GC isn't considered stable.

The only change in the post-1.0 GC is that it doesn't scan numeric types for pointers (e.g. uint[]). Are you sure you're not storing the pointers/references in a numeric type somewhere? If you aren't, then try to create a test case and file a bug report at http://d.puremagic.com/issues/ The last bugs with the new GC should have been fixed in DMD 1.004/GDC 0.22.

By "pointer voodoo" I meant sticking pointers where they don't belong or modifying the bits. "The only change" you refer to had side affects; some of which were fixed, not sure if all. I don't think it was as simple as you make it sound to be. This is why I don't think it's considered "stable" yet; it just hasn't been proven like the old one. You telling me to file a possible bug somewhat proves my point.
Feb 24 2007
parent reply Tyler Knott <tywebmail mailcity.com> writes:
Chris Miller wrote:
 "The only change" you refer to had side affects; some of which were 
 fixed, not sure if all. I don't think it was as simple as you make it 
 sound to be. 

The change to the GC *was* non-trivial, true, but on well-behaved code (which doesn't store pointers anywhere it shouldn't), all issues related to that change should have been resolved by DMD 1.005 at the latest. I searched through the D Bugzilla database and there are no open issues related to GC mis-collecting objects.
 This is why I don't think it's considered "stable" yet; it 
 just hasn't been proven like the old one. You telling me to file a 
 possible bug somewhat proves my point.

Based on the amount of response to your original post, it seems you're currently the only person still having issues with the new GC. Because the GC is so important to D, any bugs found in it get fixed very promptly (usually in the next release of DMD/Phobos after they're reported). However, before a bug can be fixed, it must first be reported with enough information for Walter to reproduce and examine it. If you think you've found a new bug in the new GC, which you likely have if your code isn't doing "pointer voodoo" (even unintentionally), make sure you're using the latest version of DMD and Phobos (currently 1.007). If you're using the latest DMD, or upgrade and are still experiencing the bug, put together a simple test case and/or a good description of the circumstances where the bug appears and file it in Bugzilla (at http://d.puremagic.com/issues/), with a high priority and severity (because GC problems are). This won't guarantee that your issue gets fixed, but it is a very big "first step." Additionally, if you feel that -v1 should imply std.gc.setV1_0() then you should also file a bug report with a low severity. I do think this would be a good compiler enhancement, but it's neither critical nor will it fix your problem with the new GC (which is the real issue here).
Feb 24 2007
parent Tyler Knott <tywebmail mailcity.com> writes:
John Reimer wrote:

 Umm...  Chris Miller is one of D language forefathers.  I think he knows
 all this. ;)
 
 -JJR

Oh, I didn't realize. I didn't start following the community very closely until just before 1.0.
Feb 24 2007
prev sibling parent John Reimer <terminal.node gmail.com> writes:
On Sat, 24 Feb 2007 16:36:55 -0600, Tyler Knott wrote:

 Chris Miller wrote:
 "The only change" you refer to had side affects; some of which were 
 fixed, not sure if all. I don't think it was as simple as you make it 
 sound to be. 

The change to the GC *was* non-trivial, true, but on well-behaved code (which doesn't store pointers anywhere it shouldn't), all issues related to that change should have been resolved by DMD 1.005 at the latest. I searched through the D Bugzilla database and there are no open issues related to GC mis-collecting objects.
 This is why I don't think it's considered "stable" yet; it 
 just hasn't been proven like the old one. You telling me to file a 
 possible bug somewhat proves my point.

Based on the amount of response to your original post, it seems you're currently the only person still having issues with the new GC. Because the GC is so important to D, any bugs found in it get fixed very promptly (usually in the next release of DMD/Phobos after they're reported). However, before a bug can be fixed, it must first be reported with enough information for Walter to reproduce and examine it. If you think you've found a new bug in the new GC, which you likely have if your code isn't doing "pointer voodoo" (even unintentionally), make sure you're using the latest version of DMD and Phobos (currently 1.007). If you're using the latest DMD, or upgrade and are still experiencing the bug, put together a simple test case and/or a good description of the circumstances where the bug appears and file it in Bugzilla (at http://d.puremagic.com/issues/), with a high priority and severity (because GC problems are). This won't guarantee that your issue gets fixed, but it is a very big "first step." Additionally, if you feel that -v1 should imply std.gc.setV1_0() then you should also file a bug report with a low severity. I do think this would be a good compiler enhancement, but it's neither critical nor will it fix your problem with the new GC (which is the real issue here).

Umm... Chris Miller is one of D language forefathers. I think he knows all this. ;) -JJR
Feb 24 2007