www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6321] New: stack overflow error while compiling with DMD

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

           Summary: stack overflow error while compiling with DMD
           Product: D
           Version: 1.057
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: anteusz freemail.hu



WHile running this...
D:\standalone\dmd.2.054\dmd2\windows\bin\dmd  -debug -O 
-ID:\src\antlr-3.3\antlr-3.3\runtime\D D:\m\antlr\backendd\runparser.d
D:\m\antlr\PLSQL3_2_DLexer.d D:\m\antlr\PLSQL3_2_DParser.d
ofD:\m\antlr\backendd\plsqlparser.exe %runtime%\BaseRecognizer.d
%runtime%\BaseRecognizerConnector.d %runtime%\BitSet.d %runtime%\CharStream.d
%runtime%\CommonToken.d %runtime%\EarlyExitException.d
%runtime%\FailedPredicateException.d %runtime%\IntStream.d
%runtime%\JavaExceptions.d %runtime%\Lexer.d
%runtime%\MismatchedNotSetException.d %runtime%\MismatchedRangeException.d
%runtime%\MismatchedSetException.d %runtime%\MismatchedTokenException.d
%runtime%\MismatchedTreeNodeException.d %runtime%\MissingTokenException.d
%runtime%\NoViableAltException.d %runtime%\RecognitionException.d
%runtime%\RecognizerSharedState.d %runtime%\Token.d %runtime%\TokenSource.d
%runtime%\TokenStream.d %runtime%\UnwantedTokenException.d
%runtime%\tree\BaseTree.d %runtime%\tree\CommonTree.d %runtime%\tree\Tree.d
%runtime%\tree\TreeAdaptor.d %runtime%\tree\TreeNodeStream.d
%runtime%\ANTLRStringStream.d %runtime%\CharStreamState.d  %runtime%\Parser.d
%runtime%\CommonTokenStream.d %runtime%\BufferedTokenStream.d %runtime%\dfa.d
%runtime%\RuleReturnScope.d %runtime%\tree\CommonTreeAdaptor.d
%runtime%\tree\BaseTreeAdaptor.d  %runtime%\ParserRuleReturnScope.d 
%runtime%\tree\CommonErrorNode.d  %runtime%\tree\RewriteRuleTokenStream.d
%runtime%\tree\RewriteRuleSubtreeStream.d
%runtime%\tree\RewriteRuleElementStream.d
%runtime%\tree\RewriteCardinalityException.d
%runtime%\tree\RewriteEmptyStreamException.d -debug=trace_consume



if you have a debug version of DMD, please give it to me,,,, let us get it over
quickly.

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




So I get a very simple error: Stack overflow

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




Version 2.054

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


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de



This doesn't help much, if you don't even specify what exact source files
you've used (I mean where you got them etc).

Also a stacktrace would be helpful if you can manage to get that.

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





 This doesn't help much, if you don't even specify what exact source files
 you've used (I mean where you got them etc).
 
 Also a stacktrace would be helpful if you can manage to get that.
How do I get a stacktrace from dmd? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6321




I know it does not ctfe.

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




On Linux you would typically use GDB, but on Windows it's another question.
You could debug it with Visual Studio (or WinDbg maybe)
or use some other tool/code.
http://stackoverflow.com/questions/105659/how-can-one-grab-a-stack-trace-in-c

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


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh gmail.com



06:24:53 PDT ---
Another thing to try is to run dmd in verbose mode: 
dmd -v <...>

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




running with -v
....
function  toString
function  toString
function  fill
function  clear
code      DFA
function  predict
function  noViableAlt
function  error
function  specialStateTransition
function  getDescription
function  unpackEncodedString
function  unpackEncodedStringToUnsignedChars
function  writeln
function  __dgliteral1522
function  writeln
function  __dgliteral1529
function  writeln
function  __dgliteral1534
function  writeln
function  __dgliteral1556
function  writeln
function  __dgliteral1560
function  writeln
function  __dgliteral1564
function  writeln
function  __dgliteral1568
function  write
function  writeln
function  __dgliteral1571
code      RuleReturnScope
function  getStart
function  getStop
function  getTree
function  getTemplate
code      CommonTreeAdaptor
function  dupNode
function  create
function  createToken
function  createToken
function  setTokenBoundaries
function  getTokenStartIndex
function  getTokenStopIndex
function  getText
function  getType
function  getToken
function  getChild
function  getChildCount
function  getParent
function  setParent
function  getChildIndex
function  setChildIndex
function  replaceChildren
code      BaseTreeAdaptor
function  nil
function  errorNode
function  isNil
function  dupTree
function  dupTree
function  addChild
function  becomeRoot
function  rulePostProcessing
function  becomeRoot
function  create
function  create
function  create
function  create
function  getType
function  setType
function  getText
function  setText
function  getChild
function  setChild
function  deleteChild
function  getChildCount
function  getUniqueID
code      ParserRuleReturnScope
function  getStart
function  getStop
code      CommonErrorNode
function  this
function  isNil
function  getType
function  getText
function  toString
code      RewriteRuleTokenStream
function  this
function  this
function  this
function  nextNode
function  nextToken
function  toTree
function  dup
code      RewriteRuleSubtreeStream
function  this
function  this
function  this
function  nextNode
function  dup
code      RewriteRuleElementStream
function  this
function  this
function  this
function  reset
function  add
function  nextTree
function  _next
function  toTree
function  hasNext
function  size
function  getDescription
code      RewriteCardinalityException
function  this
function  getMessage
code      RewriteEmptyStreamException
function  this
Stack overflow


I guess it mean the problem is in the linker?
RewriteEmptyStreamException is the last file...

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




06:43:49 PDT ---
Now that's something.. but I'm not the one to ask about these logs really. 
To check if it's linker try: 
dmd -c <...> 
that should skip the linking stage and get you a huge object file.

Other then that let me recommend you a tool for striping down test cases:
https://github.com/CyberShadow/DustMite/wiki

And make sure you did a good test condition, mine first attempts produced
mostly empty files :)

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




Hi,

figured out..

It was caused by 
ofD:\m\antlr\backendd\plsqlparser.exe

Can you see - is missing there?


That caused the error.

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


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



16:37:33 PST ---
I can reproduce in 2.054, but in 2.057 the stack overflow does not appear
anymore and an app will be built. Closing.

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