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


--- Comment #0 from yebblies <yebblies gmail.com> 2013-11-20 17:30:18 EST ---
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


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2013-11-20
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


--- Comment #2 from yebblies <yebblies gmail.com> 2013-11-22 19:24:05 EST ---
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


--- Comment #3 from yebblies <yebblies gmail.com> 2013-11-25 11:37:55 EST ---
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


--- Comment #4 from Brad Roberts <braddr puremagic.com> 2013-11-25 18:05:32 PST
---
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



--- Comment #5 from Walter Bright <bugzilla digitalmars.com> 2013-12-24
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



--- Comment #6 from yebblies <yebblies gmail.com> 2013-12-25 02:38:15 EST ---
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



--- Comment #7 from Walter Bright <bugzilla digitalmars.com> 2013-12-24
09:49:05 PST ---
(In reply to comment #6)
 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



--- Comment #8 from Walter Bright <bugzilla digitalmars.com> 2013-12-25
13:44:49 PST ---
(In reply to comment #7)
 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



--- Comment #9 from yebblies <yebblies gmail.com> 2013-12-26 14:19:48 EST ---
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



--- Comment #10 from Brad Roberts <braddr puremagic.com> 2013-12-30 18:02:47
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


--- Comment #11 from yebblies <yebblies gmail.com> 2013-12-31 16:37:24 EST ---
(In reply to comment #10)
 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



--- Comment #12 from github-bugzilla puremagic.com 2013-12-30 22:32:18 PST ---
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
Merge pull request #3051 from yebblies/issue11559

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



--- Comment #13 from github-bugzilla puremagic.com 2013-12-31 04:13:58 PST ---
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/af1c13828ea3e66e7888e73a423dda185fd13c19
Merge pull request #3051 from yebblies/issue11559

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