Jump to page: 1 2
Thread overview
Assertion failure: '!cases' on line 2620 in file 'statement.c'
Jan 12, 2011
%u
Jan 12, 2011
%u
Jan 12, 2011
Simen kjaeraas
Jan 12, 2011
Don
Jan 12, 2011
%u
Jan 13, 2011
Don
Jan 13, 2011
%u
Jan 13, 2011
Don
Jan 13, 2011
Andrej Mitrovic
Jan 13, 2011
%u
Jan 14, 2011
Don
January 12, 2011
Assertion failure: '!cases' on line 2620 in file 'statement.c'

This is what I got from trying to build my project(30+ modules) without bud.

January 12, 2011
Should I post it as a bug, even though I have no code to accompany it?
I have no clue as to where to start my directed search for a minimal case.
January 12, 2011
%u <e@ee.com> wrote:

> Should I post it as a bug, even though I have no code to accompany it?
> I have no clue as to where to start my directed search for a minimal case.

Please do post it, yes. As for searching, if you are willing to share
the code , others may be willing to do the search.

-- 
Simen
January 12, 2011
%u wrote:
> Should I post it as a bug, even though I have no code to accompany it?
> I have no clue as to where to start my directed search for a minimal case.

Can you post the entire source code?
It's important that it be reproducible. It doesn't need to be minimal - someone else can reduce it.
January 12, 2011
== Quote from Don (nospam@nospam.com)'s article
> %u wrote:
> > Should I post it as a bug, even though I have no code to accompany it?
> > I have no clue as to where to start my directed search for a minimal case.
> Can you post the entire source code?
> It's important that it be reproducible. It doesn't need to be minimal -
> someone else can reduce it.

I crashed it again :)

Sorry, can't share the code..

I don't really have any time atm, look at it again tomorrow.

January 13, 2011
%u wrote:
> == Quote from Don (nospam@nospam.com)'s article
>> %u wrote:
>>> Should I post it as a bug, even though I have no code to accompany it?
>>> I have no clue as to where to start my directed search for a minimal case.
>> Can you post the entire source code?
>> It's important that it be reproducible. It doesn't need to be minimal -
>> someone else can reduce it.
> 
> I crashed it again :)
> 
> Sorry, can't share the code..

Bummer.

> I don't really have any time atm, look at it again tomorrow.

It's in a switch statement somewhere.
It sounds as though this is a bug which involves multiple files, so it'll be difficult to reduce it.

If you're able to compile DMD, change this line in statement.c line 2620:

Statement *SwitchStatement::semantic(Scope *sc)
{
    //printf("SwitchStatement::semantic(%p)\n", this);
    tf = sc->tf;
+   if (cases) error("xxx");
    assert(!cases);             // ensure semantic() is only run once


and then you'll get the line number where the error is.
If you can provide the function which contains the switch statement, there's a chance I could reproduce it.
January 13, 2011
== Quote from Don (nospam@nospam.com)'s article
> It's in a switch statement somewhere.
> It sounds as though this is a bug which involves multiple files, so
> it'll be difficult to reduce it.
> If you're able to compile DMD, change this line in statement.c line 2620:
> Statement *SwitchStatement::semantic(Scope *sc)
> {
>      //printf("SwitchStatement::semantic(%p)\n", this);
>      tf = sc->tf;
> +   if (cases) error("xxx");
>      assert(!cases);             // ensure semantic() is only run once
> and then you'll get the line number where the error is.

Yay for first time compiling dmd :)

> If you can provide the function which contains the switch statement, there's a chance I could reproduce it.

I've got something better.. a minimal version :)
Which even crashes through bud.

----
module main;

enum E { A = 0 };

struct S{
  int i;

  static S func( S s, E e ){
    switch( e ) //<---------- here
    {
      default:return s;
    }
  }

  static const S s_def = { 1 };
  //static const S A = func(s_def, E.A ); // forward reference error + crash
  //static const S[1] ARR = [ E.A : func(s_def, E.A )]; // error : xxx + crash
}

void main(){}
----
To test all this I switched from 1.065 to 1.066; just to make sure it hadn't been
fixed already.
And now my project won't compile any more even though bud+1.065 will happily do so..
bud+ 1.066 gives me the following (no crash though)

Max # of fixups = 89
Max # of fixups = 4
Max # of fixups = 112
Max # of fixups = 17
Max # of fixups = 2871
Max # of fixups = 233
Max # of fixups = 138
Max # of fixups = 7
Max # of fixups = 353
Max # of fixups = 446
Max # of fixups = 5
Max # of fixups = 4117
Max # of fixups = 37
Max # of fixups = 288
Max # of fixups = 330
Max # of fixups = 338
Max # of fixups = 144
Max # of fixups = 660
Max # of fixups = 51
Max # of fixups = 4
Max # of fixups = 220
Max # of fixups = 2765
Max # of fixups = 12
Max # of fixups = 5
Max # of fixups = 5564
Max # of fixups = 2714
Internal error: backend\cgobj.c 2424

What does that mean?
January 13, 2011
%u wrote:
> == Quote from Don (nospam@nospam.com)'s article
>> It's in a switch statement somewhere.
>> It sounds as though this is a bug which involves multiple files, so
>> it'll be difficult to reduce it.
>> If you're able to compile DMD, change this line in statement.c line 2620:
>> Statement *SwitchStatement::semantic(Scope *sc)
>> {
>>      //printf("SwitchStatement::semantic(%p)\n", this);
>>      tf = sc->tf;
>> +   if (cases) error("xxx");
>>      assert(!cases);             // ensure semantic() is only run once
>> and then you'll get the line number where the error is.
> 
> Yay for first time compiling dmd :)

Sorry you had to do that!

> 
>> If you can provide the function which contains the switch statement,
>> there's a chance I could reproduce it.
> 
> I've got something better.. a minimal version :)
> Which even crashes through bud.

Awesome!
I'll track this sucker down so it doesn't hit anyone else.

> 
> ----
> module main;
> 
> enum E { A = 0 };
> 
> struct S{
>   int i;
> 
>   static S func( S s, E e ){
>     switch( e ) //<---------- here
>     {
>       default:return s;
>     }
>   }
> 
>   static const S s_def = { 1 };
>   //static const S A = func(s_def, E.A ); // forward reference error + crash
>   //static const S[1] ARR = [ E.A : func(s_def, E.A )]; // error : xxx + crash
> }
> 
> void main(){}
> ----
> To test all this I switched from 1.065 to 1.066; just to make sure it hadn't been
> fixed already.
> And now my project won't compile any more even though bud+1.065 will happily do so..
> bud+ 1.066 gives me the following (no crash though)
> 
> Max # of fixups = 89
> Max # of fixups = 4
> Max # of fixups = 112
> Max # of fixups = 17
> Max # of fixups = 2871
> Max # of fixups = 233
> Max # of fixups = 138
> Max # of fixups = 7
> Max # of fixups = 353
> Max # of fixups = 446
> Max # of fixups = 5
> Max # of fixups = 4117
> Max # of fixups = 37
> Max # of fixups = 288
> Max # of fixups = 330
> Max # of fixups = 338
> Max # of fixups = 144
> Max # of fixups = 660
> Max # of fixups = 51
> Max # of fixups = 4
> Max # of fixups = 220
> Max # of fixups = 2765
> Max # of fixups = 12
> Max # of fixups = 5
> Max # of fixups = 5564
> Max # of fixups = 2714
> Internal error: backend\cgobj.c 2424
> 
> What does that mean?

The DMD makefile compiles in debug mode by default. It prints some useless 'fixups' junk. You need to compile with make -fwin32.mak release
or make -flinux.mak release
to make a release compiler. But, not important, you can go back to using an official compiler again. <g>
The internal error means it's now crashing in the backend, rather than the frontend. Not an improvement!
January 13, 2011
On 1/13/11, Don <nospam@nospam.com> wrote:
> The DMD makefile compiles in debug mode by default. It prints some
> useless 'fixups' junk. You need to compile with make -fwin32.mak release
> or make -flinux.mak release
> to make a release compiler.

Ugh, I just realized I was using DMD in debug mode by mistake for the last couple of weeks. Thanks for the info (I should have looked this up).
January 13, 2011
== Quote from Don (nospam@nospam.com)'s article
> > Yay for first time compiling dmd :)
> Sorry you had to do that!

Had to learn that once anyway :)
Maybe I'll even be able to take a stab at fixing bugs someday..





« First   ‹ Prev
1 2