www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Strange DMD Assertion failure

reply "Chris Miller" <chris dprogramming.com> writes:
Compiling code that worked fine with DMD 0.160 now fails on DMD 0.161 with  
the following compiler error:
    Assertion failure: 'next' on line 2226 in file 'mtype.c'

Looking at mtype.c I notice the assert makes sure 'next' is not null, but  
on the next line it checks 'next' for null and acts appropriately; also,  
in the same function of DMD 0.160 this null check is not there, only the  
assert, so it leads me to believe that perhaps the new compiler now allows  
a null 'next' but the assert was left accidentally.

I tried simplifying my code to make a small reproducable example, but this  
project is huge and the changes were causing template mixin forward  
reference errors. Compiling with -v shows it fails on the first semantic  
pass.

- Chris
Jun 22 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Chris Miller wrote:
 Compiling code that worked fine with DMD 0.160 now fails on DMD 0.161 
 with the following compiler error:
    Assertion failure: 'next' on line 2226 in file 'mtype.c'
 
 Looking at mtype.c I notice the assert makes sure 'next' is not null, 
 but on the next line it checks 'next' for null and acts appropriately; 
 also, in the same function of DMD 0.160 this null check is not there, 
 only the assert, so it leads me to believe that perhaps the new compiler 
 now allows a null 'next' but the assert was left accidentally.
 
 I tried simplifying my code to make a small reproducable example, but 
 this project is huge and the changes were causing template mixin forward 
 reference errors. Compiling with -v shows it fails on the first semantic 
 pass.

There's no way to track this down without a reproducible test case.
Jun 23 2006
next sibling parent Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Walter Bright wrote:
 Chris Miller wrote:
 Compiling code that worked fine with DMD 0.160 now fails on DMD 0.161
 with the following compiler error:
    Assertion failure: 'next' on line 2226 in file 'mtype.c'

 Looking at mtype.c I notice the assert makes sure 'next' is not null,
 but on the next line it checks 'next' for null and acts appropriately;
 also, in the same function of DMD 0.160 this null check is not there,
 only the assert, so it leads me to believe that perhaps the new
 compiler now allows a null 'next' but the assert was left accidentally.

 I tried simplifying my code to make a small reproducable example, but
 this project is huge and the changes were causing template mixin
 forward reference errors. Compiling with -v shows it fails on the
 first semantic pass.

There's no way to track this down without a reproducible test case.

Have a look at Carlos Santander's post "ice returning a delegate".
Jun 23 2006
prev sibling parent reply Bruno Medeiros <brunodomedeirosATgmail SPAM.com> writes:
Walter Bright wrote:
 Chris Miller wrote:
 Compiling code that worked fine with DMD 0.160 now fails on DMD 0.161 
 with the following compiler error:
    Assertion failure: 'next' on line 2226 in file 'mtype.c'

 Looking at mtype.c I notice the assert makes sure 'next' is not null, 
 but on the next line it checks 'next' for null and acts appropriately; 
 also, in the same function of DMD 0.160 this null check is not there, 
 only the assert, so it leads me to believe that perhaps the new 
 compiler now allows a null 'next' but the assert was left accidentally.

 I tried simplifying my code to make a small reproducable example, but 
 this project is huge and the changes were causing template mixin 
 forward reference errors. Compiling with -v shows it fails on the 
 first semantic pass.

There's no way to track this down without a reproducible test case.

template tpl() { typeof( {} ) foo; } int main(char[][] args) { tpl!(); return 0; } » Assertion failure: 'next' on line 2226 in file 'mtype.c' Not sure if this is the same as bug 220, since that one asserts on a different line (altough on the same file), and the test case seems different. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Jun 23 2006
parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruno Medeiros schrieb am 2006-06-23:

[snip]
    template tpl() {
      typeof( {} ) foo;
    }

    int main(char[][] args)
    {
      tpl!();
      return 0;
    }

  Assertion failure: 'next' on line 2226 in file 'mtype.c'

 Not sure if this is the same as bug 220, since that one asserts on a 
 different line (altough on the same file), and the test case seems 
 different.

Added to DStress as http://dstress.kuehne.cn/run/b/bug_mtype_2226_A.d http://dstress.kuehne.cn/run/b/bug_mtype_2226_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEo7ja3w+/yD4P9tIRApoZAKCkzviTOmEau6ZnPqYwlHVKtnwqfACfbqbh apH8t/ytCqHn2K2//Ens2JU= =oPTq -----END PGP SIGNATURE-----
Jun 29 2006
parent Bruno Medeiros <brunodomedeirosATgmail SPAM.com> writes:
Thomas Kuehne wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 Bruno Medeiros schrieb am 2006-06-23:
 
 [snip]
 
    template tpl() {
      typeof( {} ) foo;
    }

    int main(char[][] args)
    {
      tpl!();
      return 0;
    }

 � Assertion failure: 'next' on line 2226 in file 'mtype.c'

 Not sure if this is the same as bug 220, since that one asserts on a 
 different line (altough on the same file), and the test case seems 
 different.

Added to DStress as http://dstress.kuehne.cn/run/b/bug_mtype_2226_A.d http://dstress.kuehne.cn/run/b/bug_mtype_2226_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEo7ja3w+/yD4P9tIRApoZAKCkzviTOmEau6ZnPqYwlHVKtnwqfACfbqbh apH8t/ytCqHn2K2//Ens2JU= =oPTq -----END PGP SIGNATURE-----

Seems this was fixed in DMD 162. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Jul 01 2006