www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11559] New: Optlink crash with more than 2048 modules generated

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

           Summary: Optlink crash with more than 2048 modules generated
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: critical
          Priority: P2
         Component: Optlink
        AssignedTo: nobody puremagic.com
        ReportedBy: yebblies gmail.com



Due to https://github.com/D-Programming-Language/dmd/pull/2785 dmd now
generates one module per mixin line.

string gen()
{
    string m;
    foreach(i; 0..2048)
        m ~= "mixin(\"assert(0);\");\n";
    return m;
}

void main()
{
    mixin(gen());
}

Causes a dmd regression.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 19 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559


Walter Bright <bugzilla digitalmars.com> changed:

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



21:09:32 PST ---
Well, that was unexpected.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Optlink crash with more     |Optlink crash with more
                   |than 2048 modules generated |than 2048 modules generated
                   |                            |and debug info



I forgot to add: This only happens with debug info enabled.  -g or -gc make it
crash.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 22 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559


9999 <mailnew4ster gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mailnew4ster gmail.com
           Severity|critical                    |regression


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |critical



This is the optlink bug, which is not a regression.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |braddr puremagic.com
           Severity|critical                    |regression



---
Changing back to regression.  It's not directly a regression of dmd, but the
combination of a dmd change and an optlink limit results in code that built
before not building now.

It's the same category of issues as any bug that causes the linker to reject a
dmd generated object file.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




01:16:36 PST ---
Fixed in Optlink 8.00.14:

http://ftp.digitalmars.com/optlink.zip

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




How much did you bump it by?  The original test case now works, but this fails:

string gen()
{
    string m;
    foreach(i; 0..4096)
        m ~= "mixin(\"assert(0);\n\n\n\n\");\n";
    return m;
}

void main()
{
    mixin(gen());
}

I'm mixin'ing a string into each function in ddmd, so this isn't a synthetic
test case.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




09:49:05 PST ---

 How much did you bump it by?
I didn't bump it at all. I changed the allocation scheme for that table to one that allocated the desired size, rather than allocating a 16K buffer and hoping it wouldn't overflow. You're probably seeing an overflow from another table. I'll look into it. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 24 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




13:44:49 PST ---

 You're probably seeing an overflow from another table. I'll look into it.
I found that particular problem and uploaded a fix. http://ftp.digitalmars.com/optlink.zip -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




Thanks, it works for me.  We'll need to add a test case once the win32
autotester has been updated.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




PST ---
The win32 auto-tester is updated with the new optlink.  The unittest can be
added now.  A bit of communication is warranted about this fix, since as soon
as the test is checked in, every developer who runs the tests will be hit by
the bug.

I've uploaded the new optlink to:

  http://downloads.dlang.org/other/optlink-8.00.14.zip

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


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull




 The win32 auto-tester is updated with the new optlink.  The unittest can be
 added now.  A bit of communication is warranted about this fix, since as soon
 as the test is checked in, every developer who runs the tests will be hit by
 the bug.
 
 I've uploaded the new optlink to:
 
   http://downloads.dlang.org/other/optlink-8.00.14.zip
I opened https://github.com/D-Programming-Language/dmd/pull/3051 to add the test case. I named the test case test11559upgradeoptlink.d - it should be fairly obvious what needs doing when it fails. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11559




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

https://github.com/D-Programming-Language/dmd/commit/bcd35f71f122840fec5eec137b169cbb9057dc7c
Fix Issue 11559 - Optlink crash with more than 2048 modules generated and debug
info

https://github.com/D-Programming-Language/dmd/commit/72380cf1abe9ad1937f8ec4523953ca825c82151


Fix Issue 11559 - Optlink crash with more than 2048 modules generated and debug
info

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


yebblies <yebblies gmail.com> changed:

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


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




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

https://github.com/D-Programming-Language/dmd/commit/af1c13828ea3e66e7888e73a423dda185fd13c19


Fix Issue 11559 - Optlink crash with more than 2048 modules generated and debug
info

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 31 2013