www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD crash

reply Magnus Lie Hetland <magnus hetland.org> writes:
When compiling a project I now get the following error from dmd (2.052, 
Mac OS X):

  Assertion failed: (!vthis->csym), function toObjFile, file glue.c, line 703.

(No traceback.)

I've been able to locate the problem -- a call to topN. However, when 
I've tried to isolate and compile the relevant parts of the code, I 
haven't been able to isolate it properly. I'm willing to incrementally 
prune down a clone of my project to create a minimal example, but I'd 
just thought I'd hear if this is a known issue, or if anyone had tips 
on what to do/look for.

I see that the same issue was emailed to the bugs-list in 2006 
(although at that time, the assertion seems to have been on line 402):

  http://bit.ly/fSS7xZ

Any insights?

-- 
Magnus Lie Hetland
http://hetland.org
Mar 23 2011
parent reply Magnus Lie Hetland <magnus hetland.org> writes:
On 2011-03-23 21:51:17 +0100, Magnus Lie Hetland said:

 When compiling a project I now get the following error from dmd (2.052, 
 Mac OS X):
 
   Assertion failed: (!vthis->csym), function toObjFile, file glue.c, line 703.

OK, I've managed to simplify thing down about as far as they can go, while still triggering this bug. As far as I can see, it requires two files (when I tried combining them, the error went away). Also, inlining is part of the problem, it seems. (Interestingly, when I try to use topN *without* my custom comparison, I get the error "Error: function std.algorithm.topN!("a < b",cast(SwapStrategy)0,uint[]).topN compiler error, parameter 'r', bugzilla 2962?".) // foo.d: #!/usr/bin/env rdmd -inline import std.random; import bar; void main() { func(); } // bar.d: import std.algorithm; void func() { bool myLess(uint a, uint b) { return a < b; } void inner(uint[] slice) { topN!myLess(slice, 0); } } And when I run foo.d, I get the assertion failure reported above. Anyone recognize this as a known error? -- Magnus Lie Hetland http://hetland.org
Mar 23 2011
parent KennyTM~ <kennytm gmail.com> writes:
On Mar 24, 11 05:46, Magnus Lie Hetland wrote:
 On 2011-03-23 21:51:17 +0100, Magnus Lie Hetland said:

 When compiling a project I now get the following error from dmd
 (2.052, Mac OS X):

 Assertion failed: (!vthis->csym), function toObjFile, file glue.c,
 line 703.

OK, I've managed to simplify thing down about as far as they can go, while still triggering this bug. As far as I can see, it requires two files (when I tried combining them, the error went away). Also, inlining is part of the problem, it seems. (Interestingly, when I try to use topN *without* my custom comparison, I get the error "Error: function std.algorithm.topN!("a < b",cast(SwapStrategy)0,uint[]).topN compiler error, parameter 'r', bugzilla 2962?".) // foo.d: #!/usr/bin/env rdmd -inline import std.random; import bar; void main() { func(); } // bar.d: import std.algorithm; void func() { bool myLess(uint a, uint b) { return a < b; } void inner(uint[] slice) { topN!myLess(slice, 0); } } And when I run foo.d, I get the assertion failure reported above. Anyone recognize this as a known error?

For the ICE, it's likely 5754 or 4129. 5754: http://d.puremagic.com/issues/show_bug.cgi?id=5754 4129: http://d.puremagic.com/issues/show_bug.cgi?id=4129
Mar 23 2011