www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - VisualD: VisualDComServer.exe crashes frequently inside D_Parser.dll

reply "Random D-user" <no email.com> writes:
I've been toying around with my hobby project lately and VisualD 
parser often (randomly) crashes in the background (and popping 
crashed program dialog of course). So I decided to post this 
quick bug report on the off chance it helps to fix it.

My project compiles with latest DMD 2.067.1 without errors or 
warnings, but it uses quite a bit of legacy d1.0 idioms, since I 
just ported to 2.0 recently.

For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 shell.

Launching visual studio debugger on crash gives:

An unhandled exception of type 'System.StackOverflowException' 
occurred in D_Parser.dll

	D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R
solver.AbstractType 
t, bool pretty)	
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) ...
May 01 2015
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
Seems like it is recursing endlessly while generating a string 
representation of some code, maybe a tool tip.

Can you reduce the relevant code that triggers this and post it here?

Rainer

On 01.05.2015 09:26, Random D-user wrote:
 I've been toying around with my hobby project lately and VisualD parser
 often (randomly) crashes in the background (and popping crashed program
 dialog of course). So I decided to post this quick bug report on the off
 chance it helps to fix it.

 My project compiles with latest DMD 2.067.1 without errors or warnings,
 but it uses quite a bit of legacy d1.0 idioms, since I just ported to
 2.0 recently.

 For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 shell.

 Launching visual studio debugger on crash gives:

 An unhandled exception of type 'System.StackOverflowException' occurred
 in D_Parser.dll

     D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType
 t, bool pretty)
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) ...
May 03 2015
parent reply "Random D-user" <no email.com> writes:
Thans for reply.

Unfortunately I don't have a clue what it's parsing when it 
crashes. It pretty much just randomly crashes (suddenly pops 
crash dialog (typically after 10 to 30 min)) as I'm typing code. 
I really haven't seen any crashes directly after attempting to 
use autocomplete, goto definition etc.

My codebase size is 15K+ loc, so isolating the crash is not 
trivial.

Is there any kind of log, debug message etc. for the visuald 
parser?
It would really help if I knew what type it was parsing when it 
crashed.

On Sunday, 3 May 2015 at 13:55:05 UTC, Rainer Schuetze wrote:
 Seems like it is recursing endlessly while generating a string 
 representation of some code, maybe a tool tip.

 Can you reduce the relevant code that triggers this and post it 
 here?

 Rainer

 On 01.05.2015 09:26, Random D-user wrote:
 I've been toying around with my hobby project lately and 
 VisualD parser
 often (randomly) crashes in the background (and popping 
 crashed program
 dialog of course). So I decided to post this quick bug report 
 on the off
 chance it helps to fix it.

 My project compiles with latest DMD 2.067.1 without errors or 
 warnings,
 but it uses quite a bit of legacy d1.0 idioms, since I just 
 ported to
 2.0 recently.

 For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 
 shell.

 Launching visual studio debugger on crash gives:

 An unhandled exception of type 'System.StackOverflowException' 
 occurred
 in D_Parser.dll

    
 D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType
 t, bool pretty)
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) ...
May 03 2015
parent reply "Random D-user" <no email.com> writes:
I've been playing more with this and it seems that now my 
msvc2013 shell also crashes from time to time. But I think it 
only crashes after VisualDComServer.exe has crashed first.

So, it looks like the issue might be editor/visuald trying to 
build a "data tip" on mouse hover.
That would match your tool tip guess. And I guess this could also 
explain why it's so random, since the mouse cursor probably just 
randomly hovers on top of some code while I type.

Perhaps I just need to bite the bullet and try to build 
visualDComParser myself so that I can debug what's wrong with it. 
(no promises though :))

Anyway, the msvc2013 crash exception is:

-$exception	{System.AccessViolationException: Attempted to read 
or write protected memory. This is often an indication that other 
memory is corrupt.
at 
Microsoft.VisualStudio.TextManager.Interop.IVsTextViewFilter.GetDa
aTipText(TextSpan[] 
pSpan, String& pbstrText)
at 
Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromFilt
r(IQuickInfoSession 
session, TextSpan[] dataBufferTextSpan, String& tipText)
at 
Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSessi
n(IQuickInfoSession 
session, IList`1 qiContent, ITrackingSpan& applicableToSpan)
at 
Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate()
at 
Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start()
at 
Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextVi
w_MouseHover(Object 
sender, MouseHoverEventArgs e)
at 
Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()
at 
Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView
OnHoverTimer(Object 
sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object 
unused)
...

On Sunday, 3 May 2015 at 14:26:22 UTC, Random D-user wrote:
 Thans for reply.

 Unfortunately I don't have a clue what it's parsing when it 
 crashes. It pretty much just randomly crashes (suddenly pops 
 crash dialog (typically after 10 to 30 min)) as I'm typing 
 code. I really haven't seen any crashes directly after 
 attempting to use autocomplete, goto definition etc.

 My codebase size is 15K+ loc, so isolating the crash is not 
 trivial.

 Is there any kind of log, debug message etc. for the visuald 
 parser?
 It would really help if I knew what type it was parsing when it 
 crashed.

 On Sunday, 3 May 2015 at 13:55:05 UTC, Rainer Schuetze wrote:
 Seems like it is recursing endlessly while generating a string 
 representation of some code, maybe a tool tip.

 Can you reduce the relevant code that triggers this and post 
 it here?

 Rainer

 On 01.05.2015 09:26, Random D-user wrote:
 I've been toying around with my hobby project lately and 
 VisualD parser
 often (randomly) crashes in the background (and popping 
 crashed program
 dialog of course). So I decided to post this quick bug report 
 on the off
 chance it helps to fix it.

 My project compiles with latest DMD 2.067.1 without errors or 
 warnings,
 but it uses quite a bit of legacy d1.0 idioms, since I just 
 ported to
 2.0 recently.

 For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 
 shell.

 Launching visual studio debugger on crash gives:

 An unhandled exception of type 
 'System.StackOverflowException' occurred
 in D_Parser.dll

   
 D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType
 t, bool pretty)
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) ...
May 06 2015
parent reply "Random D-user" <no email.com> writes:
I went through hovering all the symbols and it turns out that the 
bindings in Derelict lib actually trigger the crash.
 From there I managed to quickly do a small repro case that 
crashes for me in completely new empty visuald project:

module mytest;

int function(uint) TestCase;
TestCase test;

class TestClass
{
     this()
     {
         test(); // <--- hover on this
     }
}


On Wednesday, 6 May 2015 at 14:36:52 UTC, Random D-user wrote:
 I've been playing more with this and it seems that now my 
 msvc2013 shell also crashes from time to time. But I think it 
 only crashes after VisualDComServer.exe has crashed first.

 So, it looks like the issue might be editor/visuald trying to 
 build a "data tip" on mouse hover.
 That would match your tool tip guess. And I guess this could 
 also explain why it's so random, since the mouse cursor 
 probably just randomly hovers on top of some code while I type.

 Perhaps I just need to bite the bullet and try to build 
 visualDComParser myself so that I can debug what's wrong with 
 it. (no promises though :))

 Anyway, the msvc2013 crash exception is:

 -$exception	{System.AccessViolationException: Attempted to read 
 or write protected memory. This is often an indication that 
 other memory is corrupt.
 at 
 Microsoft.VisualStudio.TextManager.Interop.IVsTextViewFilter.GetDa
aTipText(TextSpan[] 
 pSpan, String& pbstrText)
 at 
 Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromFilt
r(IQuickInfoSession 
 session, TextSpan[] dataBufferTextSpan, String& tipText)
 at 
 Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSessi
n(IQuickInfoSession 
 session, IList`1 qiContent, ITrackingSpan& applicableToSpan)
 at 
 Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate()
 at 
 Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start()
 at 
 Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextVi
w_MouseHover(Object 
 sender, MouseHoverEventArgs e)
 at 
 Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()
 at 
 Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView
OnHoverTimer(Object 
 sender, EventArgs e)
 at System.Windows.Threading.DispatcherTimer.FireTick(Object 
 unused)
 ...

 On Sunday, 3 May 2015 at 14:26:22 UTC, Random D-user wrote:
 Thans for reply.

 Unfortunately I don't have a clue what it's parsing when it 
 crashes. It pretty much just randomly crashes (suddenly pops 
 crash dialog (typically after 10 to 30 min)) as I'm typing 
 code. I really haven't seen any crashes directly after 
 attempting to use autocomplete, goto definition etc.

 My codebase size is 15K+ loc, so isolating the crash is not 
 trivial.

 Is there any kind of log, debug message etc. for the visuald 
 parser?
 It would really help if I knew what type it was parsing when 
 it crashed.

 On Sunday, 3 May 2015 at 13:55:05 UTC, Rainer Schuetze wrote:
 Seems like it is recursing endlessly while generating a 
 string representation of some code, maybe a tool tip.

 Can you reduce the relevant code that triggers this and post 
 it here?

 Rainer

 On 01.05.2015 09:26, Random D-user wrote:
 I've been toying around with my hobby project lately and 
 VisualD parser
 often (randomly) crashes in the background (and popping 
 crashed program
 dialog of course). So I decided to post this quick bug 
 report on the off
 chance it helps to fix it.

 My project compiles with latest DMD 2.067.1 without errors 
 or warnings,
 but it uses quite a bit of legacy d1.0 idioms, since I just 
 ported to
 2.0 recently.

 For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 
 shell.

 Launching visual studio debugger on crash gives:

 An unhandled exception of type 
 'System.StackOverflowException' occurred
 in D_Parser.dll

  
 D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType
 t, bool pretty)
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver. ResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.R solver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.R solver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolve .DelegateCallSymbol t) ...
May 06 2015
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
Thanks for reducing it to a reproducible test case (I can confirm the 
stack overflow). I've reported a bug here: 
https://github.com/aBothe/D_Parser/issues/191

Alex is usually very fast fixing these issues ;-)


On 06.05.2015 16:57, Random D-user wrote:
 I went through hovering all the symbols and it turns out that the
 bindings in Derelict lib actually trigger the crash.
  From there I managed to quickly do a small repro case that crashes for
 me in completely new empty visuald project:

 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
      this()
      {
          test(); // <--- hover on this
      }
 }


 On Wednesday, 6 May 2015 at 14:36:52 UTC, Random D-user wrote:
 I've been playing more with this and it seems that now my msvc2013
 shell also crashes from time to time. But I think it only crashes
 after VisualDComServer.exe has crashed first.

 So, it looks like the issue might be editor/visuald trying to build a
 "data tip" on mouse hover.
 That would match your tool tip guess. And I guess this could also
 explain why it's so random, since the mouse cursor probably just
 randomly hovers on top of some code while I type.

 Perhaps I just need to bite the bullet and try to build
 visualDComParser myself so that I can debug what's wrong with it. (no
 promises though :))

 Anyway, the msvc2013 crash exception is:

 -$exception    {System.AccessViolationException: Attempted to read or
 write protected memory. This is often an indication that other memory
 is corrupt.
 at
 Microsoft.VisualStudio.TextManager.Interop.IVsTextViewFilter.GetDataTipText(TextSpan[]
 pSpan, String& pbstrText)
 at
 Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromFilter(IQuickInfoSession
 session, TextSpan[] dataBufferTextSpan, String& tipText)
 at
 Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession
 session, IList`1 qiContent, ITrackingSpan& applicableToSpan)
 at
 Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate()

 at
 Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start()

 at
 Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextView_MouseHover(Object
 sender, MouseHoverEventArgs e)
 at
 Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()

 at
 Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnHoverTimer(Object
 sender, EventArgs e)
 at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
 ...

 On Sunday, 3 May 2015 at 14:26:22 UTC, Random D-user wrote:
 Thans for reply.

 Unfortunately I don't have a clue what it's parsing when it crashes.
 It pretty much just randomly crashes (suddenly pops crash dialog
 (typically after 10 to 30 min)) as I'm typing code. I really haven't
 seen any crashes directly after attempting to use autocomplete, goto
 definition etc.

 My codebase size is 15K+ loc, so isolating the crash is not trivial.

 Is there any kind of log, debug message etc. for the visuald parser?
 It would really help if I knew what type it was parsing when it crashed.

 On Sunday, 3 May 2015 at 13:55:05 UTC, Rainer Schuetze wrote:
 Seems like it is recursing endlessly while generating a string
 representation of some code, maybe a tool tip.

 Can you reduce the relevant code that triggers this and post it here?

 Rainer

 On 01.05.2015 09:26, Random D-user wrote:
 I've been toying around with my hobby project lately and VisualD
 parser
 often (randomly) crashes in the background (and popping crashed
 program
 dialog of course). So I decided to post this quick bug report on
 the off
 chance it helps to fix it.

 My project compiles with latest DMD 2.067.1 without errors or
 warnings,
 but it uses quite a bit of legacy d1.0 idioms, since I just ported to
 2.0 recently.

 For Visual D I've been using v0.3.41 beta 1 and 2. MSVC2013 shell.

 Launching visual studio debugger on crash gives:

 An unhandled exception of type 'System.StackOverflowException'
 occurred
 in D_Parser.dll

 D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType

 t, bool pretty)
D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolver.DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver.IResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.Resolver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolver.DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver.IResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.Resolver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolver.DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver.IResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.Resolver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolver.DelegateCallSymbol t) D_Parser.dll!D_Parser.Resolver.DelegateCallSymbol.Accept(D_Parser.Resolver.IResolvedTypeVisitor vis) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.AcceptType(D_Parser.Resolver.AbstractType t) D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.GenerateCode(D_Parser.Resolver.AbstractType t, bool pretty) D_Parser.dll!D_Parser.Resolver.AbstractType.ToString() D_Parser.dll!D_Parser.Resolver.DTypeToCodeVisitor.VisitDelegateCallSymbol(D_Parser.Resolver.DelegateCallSymbol t) ...
May 08 2015
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 08.05.2015 11:23, Rainer Schuetze wrote:
 Thanks for reducing it to a reproducible test case (I can confirm the
 stack overflow). I've reported a bug here:
 https://github.com/aBothe/D_Parser/issues/191

 Alex is usually very fast fixing these issues ;-)
Indeed, he is. Should be fixed in the new pre-release: https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.41-beta3
 On 06.05.2015 16:57, Random D-user wrote:
 I went through hovering all the symbols and it turns out that the
 bindings in Derelict lib actually trigger the crash.
  From there I managed to quickly do a small repro case that crashes for
 me in completely new empty visuald project:

 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
      this()
      {
          test(); // <--- hover on this
      }
 }
May 08 2015
next sibling parent reply "Random D-user" <no email.com> writes:
I did some quick testing and the crash seems to be gone.

Thanks a lot.

Also, while I was testing I noticed couple new minor bugs:

struct MyStruct(T)
{
     T foo()
     {
         return def;
     }

     void foo( T var )
     {
         def = var;
     }

     T def;
}

int fun()
{
     MyStruct!(float) a;
     auto b = a.foo;         // BUG: hover on b --> "auto b" 
should be "float b" (note it does work with when only getter is 
provided)
     auto c = a.foo();       // this works ok. above should be same

     foreach( i ; 0..1 )     // BUG: hover on i --> "i" should be 
"int i"
     {
         i = i;
     }

     return 0;
}

On Friday, 8 May 2015 at 21:10:58 UTC, Rainer Schuetze wrote:
 On 08.05.2015 11:23, Rainer Schuetze wrote:
 Thanks for reducing it to a reproducible test case (I can 
 confirm the
 stack overflow). I've reported a bug here:
 https://github.com/aBothe/D_Parser/issues/191

 Alex is usually very fast fixing these issues ;-)
Indeed, he is. Should be fixed in the new pre-release: https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.41-beta3
 On 06.05.2015 16:57, Random D-user wrote:
 I went through hovering all the symbols and it turns out that 
 the
 bindings in Derelict lib actually trigger the crash.
 From there I managed to quickly do a small repro case that 
 crashes for
 me in completely new empty visuald project:

 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
     this()
     {
         test(); // <--- hover on this
     }
 }
May 09 2015
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 09.05.2015 13:45, Random D-user wrote:
 I did some quick testing and the crash seems to be gone.

 Thanks a lot.

 Also, while I was testing I noticed couple new minor bugs:
These issues are best reported directly at https://github.com/aBothe/D_Parser/issues
 struct MyStruct(T)
 {
      T foo()
      {
          return def;
      }

      void foo( T var )
      {
          def = var;
      }

      T def;
 }

 int fun()
 {
      MyStruct!(float) a;
      auto b = a.foo;         // BUG: hover on b --> "auto b" should be
 "float b" (note it does work with when only getter is provided)
      auto c = a.foo();       // this works ok. above should be same

      foreach( i ; 0..1 )     // BUG: hover on i --> "i" should be "int i"
      {
          i = i;
      }

      return 0;
 }

 On Friday, 8 May 2015 at 21:10:58 UTC, Rainer Schuetze wrote:
 On 08.05.2015 11:23, Rainer Schuetze wrote:
 Thanks for reducing it to a reproducible test case (I can confirm the
 stack overflow). I've reported a bug here:
 https://github.com/aBothe/D_Parser/issues/191

 Alex is usually very fast fixing these issues ;-)
Indeed, he is. Should be fixed in the new pre-release: https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.41-beta3
 On 06.05.2015 16:57, Random D-user wrote:
 I went through hovering all the symbols and it turns out that the
 bindings in Derelict lib actually trigger the crash.
 From there I managed to quickly do a small repro case that crashes for
 me in completely new empty visuald project:

 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
     this()
     {
         test(); // <--- hover on this
     }
 }
May 10 2015
parent reply "Random D-user" <no email.com> writes:
On Sunday, 10 May 2015 at 15:17:54 UTC, Rainer Schuetze wrote:
 Also, while I was testing I noticed couple new minor bugs:
These issues are best reported directly at https://github.com/aBothe/D_Parser/issues
Yeah, sure. You probably have way better things to do than relay other people's messages :) It's just that I don't have a github account and I don't want to create yet another empty account for just that small thing. So instead I chose to spam my bugs here (since no registration) in hopes of someone reading and fixing these (for which I'm grateful). Anyways, I found more bugs. This time they are related to Mago and VisualD (actual). I'll just post them to this same thread, so that everything is nicely contained. 1. a mouse hover tooltip crash bug when debugging with Mago. See repro below. stacktrace: Microsoft.VisualStudio.Editor.Implementation.dll!Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.TryGetQuickInfoFromFilter(Microsoft.VisualStudio.Language.Intellisen e.IQuickInfoSession session, Microsoft.VisualStudio.TextManager.Interop.TextSpan[] dataBufferTextSpan, out string tipText) Microsoft.VisualStudio.Editor.Implementation.dll!Microsoft.VisualStudio.Editor.Implementation.ShimQuickInfoSource.AugmentQuickInfoSession(Microsoft.VisualStudio.Language.Intellisen e.IQuickInfoSession session, System.Collections.Generic.IList<object> qiContent, out Microsoft.VisualStudio.Text.ITrackingSpan applicableToSpan) Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextVi w_MouseHover(object sender, Microsoft.VisualStudio.Text.Editor.MouseHoverEventArgs e) Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents() Microsoft.VisualStudio.Platform.VSEditor.dll!Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView OnHoverTimer(object sender, System.EventArgs e) repro: class MyTest { struct MyStruct { int a; } void foo() { k.a = 0; // BUG: Break on this line using Mago and hover on k --> crash } private: MyStruct k; } int main(string[] argv) { auto t = new MyTest(); t.foo(); return 0; } 2. a bug where mago forgets lines in a function. I wasn't able to do a working repro case yet (I attempted to code something similar but simpler), but I though that I'll just describe it just in case it rings a bell. Basically, I'm unable to break (or step) lines of code in a function after certain statement and mago just jumps outside of the function. It has something to do with the order of use and definition of a inner struct (inside class). If I move the inner struct definition inside the class it fixes the issue and I'm able to step the code. Example: (NOTE: not a repro case) class Foo { this() { } ~this() { } // FIX POINT 1 (see below) void fun1() { int num = 0; // These are ok, but ... float konst = 1.0f; Bar[8] bars; // BUG: Can't break to lines after this line. // Debugger steps first to definition of Bar and then out of the function. // Unless I move 'struct Bar' (from below) to 'FIX POINT 1' which fixes everything and stepping works normally. foreach( b; bars ) b.a = 100; fun2( bars, 1 ); fun3( bars, 2 ); // ... do stuff } struct Bar { int a; //... } void fun2(Bar[], int barIdx) { // do stuff } void fun3(Bar[], int barIdx) { // do more stuff } }
May 25 2015
parent reply "Kagamin" <spam here.lot> writes:
On Monday, 25 May 2015 at 17:48:17 UTC, Random D-user wrote:
 It's just that I don't have a github account and I don't want 
 to create yet another empty account for just that small thing.
see http://forum.dlang.org/post/eeupfzcqazxivlgdwtza forum.dlang.org :)
May 25 2015
parent "qdgj" <qdgj qdgj.qdgj> writes:
On Monday, 25 May 2015 at 19:49:53 UTC, Kagamin wrote:
 On Monday, 25 May 2015 at 17:48:17 UTC, Random D-user wrote:
 It's just that I don't have a github account and I don't want 
 to create yet another empty account for just that small thing.
see http://forum.dlang.org/post/eeupfzcqazxivlgdwtza forum.dlang.org :)
And he can create a free GitHub account without any valid email. There is no verification and it's usable directly. Actually GH advices to verify the email because this allows PW recovery but that's all.
May 25 2015
prev sibling parent reply "Kagamin" <spam here.lot> writes:
On Friday, 8 May 2015 at 21:10:58 UTC, Rainer Schuetze wrote:
 Indeed, he is. Should be fixed in the new pre-release:

 https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.41-beta3

 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
      this()
      {
          test(); // <--- hover on this
      }
 }
It's an invalid code, though. Maybe an error should reported for it instead of some type info?
May 09 2015
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 09.05.2015 23:49, Kagamin wrote:
 On Friday, 8 May 2015 at 21:10:58 UTC, Rainer Schuetze wrote:
 Indeed, he is. Should be fixed in the new pre-release:

 https://github.com/D-Programming-Language/visuald/releases/tag/v0.3.41-beta3


 module mytest;

 int function(uint) TestCase;
 TestCase test;

 class TestClass
 {
      this()
      {
          test(); // <--- hover on this
      }
 }
It's an invalid code, though. Maybe an error should reported for it instead of some type info?
True, though the tip shows the type of "test", not "test()". There is currently no support to display semantic errors as I suspect that there will be too many false positives.
May 10 2015