www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3544] New: optlink unexpected termination 0041338f

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

           Summary: optlink unexpected termination 0041338f
           Product: D
           Version: 1.051
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Optlink
        AssignedTo: nobody puremagic.com
        ReportedBy: anteusz freemail.hu


--- Comment #0 from anteusz freemail.hu 2009-11-23 04:38:17 PST ---
Hi,

I compiled and linker a program -debug and the linker crashed.
If I use -release flag , then the linker does not crash but then the program
crashes.
The program uses CTFE which may have to do with the crash.

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



--- Comment #1 from anteusz freemail.hu 2009-11-23 04:39:21 PST ---
Created an attachment (id=515)
the picture of the error

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



--- Comment #2 from anteusz freemail.hu 2009-11-23 04:41:33 PST ---
The program uses a large compile-time generated function which seems to 
contribute to the problem.

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


Don <clugdbug yahoo.com.au> changed:

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


--- Comment #3 from Don <clugdbug yahoo.com.au> 2009-11-23 07:08:37 PST ---
The picture doesn't help at all. You need to provide a source file which will
reproduce the error.

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



--- Comment #4 from anteusz freemail.hu 2009-11-24 04:45:08 PST ---
Created an attachment (id=516)
one file that causes the problem

this if compiled as 

dmd.exe -g compilerfailuretest.d

will produce the error.
Note download this file
too:http://www.dsource.org/projects/scregexp/browser/trunk/scregexp.d
That file is needed to place it in the same directory where
compilerfailuretest.d is located.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |link-failure


--- Comment #5 from Don <clugdbug yahoo.com.au> 2009-11-24 05:00:29 PST ---
(In reply to comment #4)
 Created an attachment (id=516) [details]
 one file that causes the problem
 
 this if compiled as 
 
 dmd.exe -g compilerfailuretest.d
 
 will produce the error.
 Note download this file
 too:http://www.dsource.org/projects/scregexp/browser/trunk/scregexp.d
 That file is needed to place it in the same directory where
 compilerfailuretest.d is located.

Thanks, I can reproduce the bug now. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 24 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #6 from anteusz freemail.hu 2009-11-24 05:04:37 PST ---
it is possible to influence the occurance of the error by
reducing the size of 
the statement ...auto perlreg = new
screg!("/(?:(?<tok>\\#(?:.*?(?:"~eol~")|.*\\z))|
(?<tok>\"(?:(?>\\\\\\\\|\\\\\"|.))*?\")|

when parameter is smaller, the error does not occur.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #515 is|0                           |1
           obsolete|                            |
 Attachment #516 is|0                           |1
           obsolete|                            |


--- Comment #7 from Don <clugdbug yahoo.com.au> 2009-11-24 06:22:39 PST ---
Created an attachment (id=517)
Somewhat reduced test case.

This cuts it down to a single, self-contained file. (Funny -- I recognize my
own code in there -- almost all the comments are mine!) There's plenty of work
still to be done in cutting in right down.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|optlink unexpected          |optlink termination
                   |termination 0041338f        |0041338f with recursive
                   |                            |nested functions


--- Comment #8 from Don <clugdbug yahoo.com.au> 2009-11-25 05:16:07 PST ---
Completely reduced test case shows it's due to nested functions.
----------
char[] foo(int n) {
  if (n == 0)  return "void xxxx() {}";
  return "void xxxx() { void yyyy() { }" ~ foo(n-1) ~ "}";
}

mixin (foo(400));

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



--- Comment #9 from Don <clugdbug yahoo.com.au> 2009-11-25 05:29:15 PST ---
Even smaller test case. Seems it happens with a depth around 512; it's probably
exceeding the maximum symbol length.
---
char[] foo(int n) {
  return "void abcde() {" ~ ( n>0 ? foo(n-1): "") ~ "}";
}

mixin (foo(500));

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


Walter Bright <bugzilla digitalmars.com> changed:

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


--- Comment #10 from Walter Bright <bugzilla digitalmars.com> 2009-11-30
02:03:52 PST ---
The test case is crashing in dmd, not optlink. It's a stack overflow.

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



--- Comment #11 from anteusz freemail.hu 2009-12-12 00:06:04 PST ---
Hi,

Should I repost my example?

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code


--- Comment #12 from Don <clugdbug yahoo.com.au> 2010-01-13 00:46:23 PST ---
(In reply to comment #10)
 The test case is crashing in dmd, not optlink. It's a stack overflow.

If you compile in debug mode, it crashes in DMD. If you compile in release mode, it crashes in OPTLINK. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 13 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #13 from anteusz freemail.hu 2010-02-11 05:23:05 PST ---
Hi,

What should I do so it gets fixed? I mean this bug.
I reported this in November.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #14 from Don <clugdbug yahoo.com.au> 2010-02-11 08:33:38 PST ---
(In reply to comment #13)
 Hi,
 
 What should I do so it gets fixed? I mean this bug.
 I reported this in November.

This is in the queue of critical but hard-to-fix and relatively obscure bugs. It is a few months away from being fixed. Note that when it gets 'fixed', it will generate a compile-time error rather than a link-time one. Bug 2315 is basically the same issue. I don't see any solution other than imposing a limit on CTFE recursion. So don't get the idea that the code will ever 'work'. It'll just fail more nicely. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #15 from anteusz freemail.hu 2010-02-11 09:09:12 PST ---
A clear error message would suffice. How could I expect more?
It would not be bad if the stack size for ctfre could be set?
Is there a way to set the stack size for ctfe??

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #16 from anteusz freemail.hu 2010-02-11 09:09:56 PST ---
A clear error message would suffice. How could I expect more?
It would not be bad if the stack size for ctfre could be set?
Is there a way to set the stack size for ctfe??

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544



--- Comment #17 from Walter Bright <bugzilla digitalmars.com> 2010-09-01
19:01:47 PDT ---
I cannot reproduce this problem. Please show exactly what commands are given to
dmd and the linker.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3544


Don <clugdbug yahoo.com.au> changed:

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


--- Comment #18 from Don <clugdbug yahoo.com.au> 2010-09-01 23:55:47 PDT ---
(In reply to comment #17)
 I cannot reproduce this problem. Please show exactly what commands are given to
 dmd and the linker.

dmd -g bug.d This was crashing with DMD2.048 and link 8.00.2. I have confirmed that link 8.00.6 fixed this. (And it's stayed fixed in 8.00.7). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 01 2010