D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6321 - stack overflow error while compiling with DMD
Summary: stack overflow error while compiling with DMD
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86_64 Windows
: P2 blocker
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 23:04 UTC by anteusz
Modified: 2014-02-15 02:19 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description anteusz 2011-07-14 23:04:43 UTC
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.
Comment 1 anteusz 2011-07-14 23:05:19 UTC
So I get a very simple error: Stack overflow
Comment 2 anteusz 2011-07-14 23:08:47 UTC
Version 2.054
Comment 3 Trass3r 2011-07-15 05:17:07 UTC
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.
Comment 4 anteusz 2011-07-15 05:39:44 UTC
(In reply to comment #3)
> 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?
Comment 5 anteusz 2011-07-15 05:41:03 UTC
I know it does not ctfe.
Comment 6 Trass3r 2011-07-15 05:46:07 UTC
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
Comment 7 Dmitry Olshansky 2011-07-15 06:24:53 UTC
Another thing to try is to run dmd in verbose mode: 
dmd -v <...>
Comment 8 anteusz 2011-07-15 06:38:06 UTC
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...
Comment 9 Dmitry Olshansky 2011-07-15 06:43:49 UTC
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 :)
Comment 10 anteusz 2011-07-15 09:48:11 UTC
Hi,

figured out..

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

Can you see - is missing there?


That caused the error.
Comment 11 Andrej Mitrovic 2012-01-21 16:37:33 UTC
I can reproduce in 2.054, but in 2.057 the stack overflow does not appear anymore and an app will be built. Closing.