www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8348] New: ICE: 'semanticRun == PASSsemantic3done' on line 547 in file 'glue.c'

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348

           Summary: ICE: 'semanticRun == PASSsemantic3done' on line 547 in
                    file 'glue.c'
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



03:54:21 PDT ---
See subject. The problem manifests itself in my GSOC project and problem is 
it's hard to narrow down. 

So somebody fluent with Dustmite can you please try to trim it down?

The source is here:
https://dl.dropbox.com/u/7100999/blackwhale-phobos-phobos-2.052-2059-g6b6badc.zip

It's a phobos fork. Don't try to build it as a whole, it fails because of other
compiler issues with const/forward reference (?).

However I use the following to test compilation only of my rewrite of std.regex
alone:
rdmd --main std\regex.d

Output:
MultiArray!(BitPacked!(32u,uint),bool)
Assertion failure: 'semanticRun == PASSsemantic3done' on line 547 in file
'glue.c'

abnormal program termination

MultiArray is a pragma(msg, ...) and is irrelevant.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




03:56:20 PDT ---
dmd being used is fresh git master 
at commit ea1f2c95a445aeeb8c8e218ebbc861b37aa4215e.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




04:31:39 PDT ---
Updated and re-tested with latest dmd from git.

https://dl.dropbox.com/u/7100999/phobos.zip

Message is the same, now line is 558.


I'll try dustmite'ing it though I'm no pro with it.
Never tried to narrow down the whole phobos and I recall it works worse on
Windows so any help or tips are most appreciated.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




08:18:56 PDT ---
Created an attachment (id=1124)
A reduced test case

Horay, dustmite makes wonders.

The end result is 2 modules ~10 lines each.

to test: extract somewhere & run 
dmd std2/regex.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




08:30:32 PDT ---
Reduced by hand even futher:

//-----------in file uni.d 
template BasicSetOps()
{
    const opBinary(string op, U)(U ) 
    if(is(typeof(U.init.isSet)) )
    {
    }

}

struct Set(T)
{

this(this) 
{
}

mixin BasicSetOps;
}

//-----------in file regex.d 
import std2.uni;

int[const(Set!uint)] trieCache;

void getTrie()
{
Set!(uint).init in trieCache;
}


All of lines seem equally important (postblit, mixed-in opBinary with exact
constraint, usage of in operator on hash etc.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei metalanguage.com
           Severity|critical                    |blocker


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


jens.k.mueller gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jens.k.mueller gmx.de
         Resolution|                            |DUPLICATE



Please look at 6395 whether it fixes this issue.

*** This issue has been marked as a duplicate of issue 6395 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------

        is obsolete|                            |



06:49:29 PST ---
Created an attachment (id=1168)
added missing module declaration

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |



06:50:35 PST ---
Still doesn't work for me on dmd lastest.

commit c4dc64092ae2ae8d774ae5d9b2af5b440dfff40f
Merge: c928446 9e36de3
Author: Walter Bright <walter walterbright.com>
Date:   Wed Dec 12 02:56:01 2012 -0800



    Issue 9101 - template mixin constructor causes link error


Now it prints:
Assertion failure: 'semanticRun == PASSsemantic3done' on line 572 in file
'glue.c'

abnormal program termination

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




Then either 6395 can not be considered fixed or this is not a duplicate of
6395? What do you think?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




07:01:19 PST ---

 Then either 6395 can not be considered fixed or this is not a duplicate of
 6395? What do you think?
I'm going to try testcase for 6395 to see. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




07:41:26 PST ---


 Then either 6395 can not be considered fixed or this is not a duplicate of
 6395? What do you think?
I'm going to try testcase for 6395 to see.
Okay, I can confirm that testcase for 6395 passes for me. So this is not a duplicate of 6395 but another related bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



20:17:21 PST ---
A smaller test case:

struct Set(T)
{
    this(this) { }

    const opBinary(string op, U)(U)
      if(is(typeof(U.init.isSet)) )
      {
      }
}

int[const(Set!uint)] trieCache;

void getTrie()
{
    Set!(uint).init in trieCache;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




20:21:31 PST ---
The error is that semantic2() and semantic3() are not run for
Slot.__fieldPostBlit(). I'm pretty sure this is due to some processing being
done while gagged and never completed.

The gagging thing is the worst architectural decision in the compiler, and I
wish I'd never attempted it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




22:13:10 PST ---
Ok, here's the trouble. A postblit is generated for copying elements of the
associated array, but the postblit fails to compile because postblit doesn't
work on const arguments.

The error message was suppressed because it happened when errors were gagged.
So things were in an invalid state when writing object files.

Unfortunately, the error message was lost, so I "fixed" it by putting out a
generic message,

druntime\import\object.di(396): Error: function
object.AssociativeArray!(const(Set!(uint)),
int).AssociativeArray.Slot.__fieldPostBlit errors compiling the function

A better solution would be to find a better way to deal with gagged errors, but
at least you can now see which function failed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d5565dff3b9090c7e29627ac2b34b7bb53d5d863
fix Issue 8348 - ICE(glue.c): 'semanticRun == PASSsemantic3done' on line 547 in
file 'glue.c'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 12 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8348




10:12:42 PST ---

 Ok, here's the trouble. A postblit is generated for copying elements of the
 associated array, but the postblit fails to compile because postblit doesn't
 work on const arguments.
 
Now this highlights a bigger problem as AFAIK AA keys bascially supposed to be immutable... Anyway good to see that ICE gone.
Unfortunately, the error message was lost, so I "fixed" it by putting out a
 generic message,
druntime\import\object.di(396): Error: function
object.AssociativeArray!(const(Set!(uint)),
int).AssociativeArray.Slot.__fieldPostBlit errors compiling the function
Well, line number is a start. I'll file a diagnostic bug then as user really shouldn't see this mess. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 13 2012