www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6951] New: dependency parameter (-deps) crashes dmd in release build

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

           Summary: dependency parameter (-deps) crashes dmd in release
                    build
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: spam extrawurst.org



---
Created an attachment (id=1044)
code to crash dmd

try to build the attached main.d using this cmd line:

dmd main.d -release -inline -O -noboundscheck -deps=main.obj.dep

this crashes dmd in version 2.056.

this is especially bad because visualD automatically attaches the -deps
parameter to dmd when building a project.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6951




---
and of course i know that it imports foo and i did not attach foo.d but thats
because its not necessary to reproduce the crash...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6951




---
The following code seems to cause a related issue, i dont know. building it
with:
dmd main.d -release -O -inline -noboundscheck -deps=main.dep

gives: "Assertion failure: 'tdtypes.dim == ti->tdtypes.dim' on line 3928 in
file 'template.c'"

[CODE]
module main;

import std.stdio;

struct Test
{
    //int a;

    void foo()
    {
    //    if(&this != null)
    //        a = 2;
    }
}

void main()
{
    Test* t = new Test();

    t.foo();

    t = null;

    t.foo();
}
[/CODE]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6951


Denis <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg gmail.com



---
A bit reduced case (no -O needed, smaller user code file (but a lot of library
code is still imported))

main.d:
---
import std.math;
---

Command line for dmd 2.056:
dmd main.d -release -inline -noboundscheck -deps=main.dep

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 16 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6951


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com



Can't reproduce with dmd 2.057 head.  Is it still broken for you with the
latest version?

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




PST ---
Created an attachment (id=1053)
example code how to crash dmd

the crash seems only to happen if both switches -noboundscheck and
-deps="bug.dep" are used. if you omit one of them
the crash wont show. The command line I used is contained in the bug.bat

I have included the module btree.d witch is not referenced by the code in
main.d, but compiled with main.d on the same command line. Without the module
in the command line I can't reproduce the crash.

if you comment out the first writeln("Hello D-World!") in main() - no
crash

if you comment out the other two writeln(..) in main() - no crash

the code in main.d is totally unrelated to the code in btree.d, but there must
be something in btree.d which causes the crash.

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


Vladimir Panteleev <thecybershadow gmail.com> changed:

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



17:35:22 PST ---
bug.bat runs without problem with v2.057 on my machine.

Perhaps you can reduce a minimal test case using DustMite?

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




---
yeah with those given test cases i can't reproduce it either but with huge
include folders that i add via -I parameter the -deps parameter still crashes

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


Stephan Dilly <spam extrawurst.org> changed:

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

        is obsolete|                            |

        is obsolete|                            |



---
Created an attachment (id=1061)
testcase for dmd2057

so i found a small testcase to reproduce the crash in current dmd 2057. see new
attachment

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


Stephan Dilly <spam extrawurst.org> changed:

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

        is obsolete|                            |



---
Created an attachment (id=1062)
testcase for dmd2057

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




PST ---
ok smallest testcase so far:

[CODE]
module main;
import std.stdio;
struct BinaryHeap(T){
    T[] m_data;
    public void insert(T _val){
        m_data[$-1] = _val;
        if(m_data.length == 1) return;
    }
    public void opOpAssign(string s)(T _val){
        if(s == "~") 
        {insert(_val);}
    }
    public T front(){
        assert(!isEmpty());
        return m_data[0];    
    }
    public bool isEmpty() const{
        return (m_data.length == 0);    
    }
}
void main(string[] argv)
{
    BinaryHeap!int foo;
    foo ~= 10;
}
[/CODE]

dont forget to build with: dmd -inline -release -noboundscheck -deps=foo.dep
main.d

and just for kicks: while reducing the test case some unrelated changes made
the crash become a choke up of "Out of Memory"

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


Don <clugdbug yahoo.com.au> changed:

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



Bug 7478 appears to be the same, and has a greatly reduced test case.

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


Don <clugdbug yahoo.com.au> changed:

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



The test case works now.

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

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