Jump to page: 1 2
Thread overview
[Issue 4481] New: Internal compiler error (glue.c,!vthis->csym) or compiles, depending on the import statements order
Jul 17, 2010
Dmitry Olshansky
Jul 18, 2010
Dmitry Olshansky
Jul 18, 2010
Don
Jul 18, 2010
Dmitry Olshansky
Jul 19, 2010
Don
[Issue 4481] ICE(glue.c,!vthis->csym) or compiles, depending on the import statements order
May 20, 2012
Vladimir Panteleev
Sep 06, 2012
Ola Østtveit
Feb 18, 2013
Maxim Fomin
Jun 02, 2013
jack.un@gmail.com
Aug 11, 2013
Kenji Hara
Aug 12, 2013
Kenji Hara
July 17, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4481

           Summary: Internal compiler error (glue.c,!vthis->csym) or
                    compiles, depending on the import statements order
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: dmitry.olsh@gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2010-07-17 14:51:38 PDT ---
In some specific circumstances DMD 2.047 segfaults or not segfaults depending
on the order of imported modules.
The message produced in case of the :
Assertion failure: '!vthis->csym' on line 694 in file 'glue.c'

ATM the reliable set of conditions on which I can reproduce this are:
- at least 2 modules (all source dumped in one file avoids this issue)
- both import std.algorithm (though I still belive it has little to do with it)
- one module defines class which then uses std.reduce
- another one imports it *and* std.algorithm in a specific order.

Well, it looks like it's very subtle - one slight change and it no longer manifests. Took almost one day to cut it down to a resonable size.

//---------------- The test case ----------------
import std.algorithm;//move  this import statement after the next one or just
comment, and everything compiles
import g;

void main(){}

///g.d
module g;
import std.algorithm;

class Font{// rewriting all of the functions below as free functions and it
again compiles
public:
   int charHeight(dchar c){ return 0; }
   int textHeight(in string text){
     auto maxHeight = (int h,dchar ch){ return max(h,charHeight(ch)); };
     return reduce!(maxHeight)(text);
   }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4481



--- Comment #1 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2010-07-18 04:43:45 PDT ---
Hm, it has something to with how you pass the files to DMD, for the test case
above:
dmd g.d main.d  - compiles, all Ok
dmd main.d g.d - Assertion failure: '!vthis->csym' on line 694 in file 'glue.c'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4481


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-07-18 05:30:50 PDT ---
This looks similar to bug 2692. It's not a duplicate, but I suspect the root cause is the same.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4481



--- Comment #3 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2010-07-18 13:28:32 PDT ---
(In reply to comment #2)
> This looks similar to bug 2692. It's not a duplicate, but I suspect the root cause is the same.

I'm 100% sure you meant bug 2962 that is
"ICE(glue.c) or bad codegen passing variable as template value parameter"
and not bug 2692 which is
"alignment of double on x86 linux is incorrect" and resolved

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 19, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4481



--- Comment #4 from Don <clugdbug@yahoo.com.au> 2010-07-19 12:05:02 PDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > This looks similar to bug 2692. It's not a duplicate, but I suspect the root cause is the same.
> 
> I'm 100% sure you meant bug 2962 that is
> "ICE(glue.c) or bad codegen passing variable as template value parameter"
> and not bug 2692 which is
> "alignment of double on x86 linux is incorrect" and resolved

Correct. In this bug, it's the 'this' parameter which causes the problem, in bug 2962 it's any other function parameter.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4481


kekeniro2@yahoo.co.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kekeniro2@yahoo.co.jp


--- Comment #5 from kekeniro2@yahoo.co.jp 2012-05-18 19:16:49 PDT ---
*** Issue 8071 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4481


Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com


--- Comment #6 from Vladimir Panteleev <thecybershadow@gmail.com> 2012-05-20 14:55:05 PDT ---
Hit this again today (DMD git, also in 2.059).

In case this bug got buried or thought to be fixed, I'll note that bugs 2692 and 2962 are both marked as fixed, so this bug isn't a duplicate of those.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=4481


Ola Østtveit <olaa81@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |olaa81@gmail.com


--- Comment #7 from Ola Østtveit <olaa81@gmail.com> 2012-09-06 16:02:13 PDT ---
I got this with dmd 2.060, I got it reduced down to this:

-- main.d
module main;

import std.algorithm;
import collection;
--


-- collection.d
module collection;
import std.algorithm;

struct Collection
{
  int[] collection;

  void test(Collection[] coll)
  {
    auto element = collection[0];

    auto result = coll.map!(v => v.collection[0] * element);
  }
}
--

If the std.algorithm import is commented out in main.d it works fine, also if element is replaced with collection[0] in the map lambda in collection.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4481



--- Comment #8 from kekeniro2@yahoo.co.jp 2013-02-17 20:03:35 PST ---
2.062head has a regression caused by this problem, probably. Reduced test case is here.

Command:
 dmd.exe bug2062a.d bug2062b.d

bug2062a.d ----------------------------
void call(alias pred, R)(R haystack) {
    foreach (e; haystack) {
        pred(e);
        break;
    }
}

bug2062b.d ----------------------------
import bug2062a;

class Foo {
    void member() {
        int[] r;
        int local;
        call!(p=>local)(r); // ( (int p)=>local ) works.
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4481



--- Comment #9 from kekeniro2@yahoo.co.jp 2013-02-18 02:39:58 PST ---
(In reply to comment #8)
Sorry, 2.062 has just come, and it doesn't reproduce above.
Then, it was not a regression in 2.062head, but in 2.063head(or master).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
« First   ‹ Prev
1 2