PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Console.Writeline() hangs IDE?

Reply

Console.Writeline() hangs IDE?

 
Thread Tools Rate Thread
Old 02-02-2004, 09:47 PM   #1
Bob
Guest
 
Posts: n/a
Default Console.Writeline() hangs IDE?


I just recently noticed that when I start my applicatoin in debug mode, the IDE
hangs (no disk or CPU activity) indefinitely (at least 20 minutes). Pausing the
application shows that it's hung up at a line in a referenced assembly, one of
my own, which is a simple Console.WriteLine() statement. The stack trace shows
this line one level under the current frame, which is displayed as [<Non-user
Code>].

Anyone seen this behavior before, know what causes it?

TIA,
Bob

  Reply With Quote
Old 02-02-2004, 10:37 PM   #2
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Console.Writeline() hangs IDE?

* "Bob" <noemail@nospam.net> scripsit:
> I just recently noticed that when I start my applicatoin in debug mode, the IDE
> hangs (no disk or CPU activity) indefinitely (at least 20 minutes). Pausing the
> application shows that it's hung up at a line in a referenced assembly, one of
> my own, which is a simple Console.WriteLine() statement. The stack trace shows
> this line one level under the current frame, which is displayed as [<Non-user
> Code>].
>
> Anyone seen this behavior before, know what causes it?


Never seen before. Does that only occur at /one/ call to
'Console.WriteLine' or does this even occur in, for example, a blank or
a very simple project?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
  Reply With Quote
Old 03-02-2004, 04:37 PM   #3
Bob
Guest
 
Posts: n/a
Default Re: Console.Writeline() hangs IDE?

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uwTscTd6DHA.2264@tk2msftngp13.phx.gbl...
> Never seen before. Does that only occur at /one/ call to
> 'Console.WriteLine' or does this even occur in, for example, a blank or
> a very simple project?


Yes. This will cause a hang (as described in my original post) at iteration 20
in the loop below.

Module Main

Public Sub Main()
For i As Integer = 1 To 20
Console.WriteLine("console writeline output " & i)
Next
End Sub

End Module

The problem seems to be related to the amount of data sent to the console,
beacuse the loop below causes a hang at 11:

For i As Integer = 1 To 11
Console.WriteLine("console writeline output console writeline output console
writeline output " & i)
Next

If I make another simple project with a form and do Console.Writeline on a
button click, none of the output shows up until the application exits. And if
this output exceeds a ciritcal limit, it hangs just like in the first project.

I'd really like to know what's up with this one. But if no one else can
reproduce it, maybe I'll just have to reinstall VS.

Bob

  Reply With Quote
Old 03-02-2004, 05:06 PM   #4
Tom Leylan
Guest
 
Posts: n/a
Default Re: Console.Writeline() hangs IDE?

Bob,

Rather than play the "hit or miss" game... test your theory by instantiating
various string with a fixed number of characters such as: Dim test As String
= New String("X",2048) Choose a large value (20 times the length of your
current string for instance) and see if it is in fact the length of the
output. Then reduce the value by half until it doesn't fail. You should be
able to hit the exact length if that is a factor.

What it sounds like (but who knows what it really is) is that the output is
being redirected to some device (like an empty parallel or serial port) and
when that buffer gets full the process blocks waiting for acknowledgement.

Did it ever work? Did it just start doing it out of the blue or is this a
recent installation?

Tom

"Bob" <noemail@nospam.net> wrote...
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:uwTscTd6DHA.2264@tk2msftngp13.phx.gbl...
> > Never seen before. Does that only occur at /one/ call to
> > 'Console.WriteLine' or does this even occur in, for example, a blank or
> > a very simple project?

>
> Yes. This will cause a hang (as described in my original post) at

iteration 20
> in the loop below.
>
> Module Main
>
> Public Sub Main()
> For i As Integer = 1 To 20
> Console.WriteLine("console writeline output " & i)
> Next
> End Sub
>
> End Module
>
> The problem seems to be related to the amount of data sent to the console,
> beacuse the loop below causes a hang at 11:
>
> For i As Integer = 1 To 11
> Console.WriteLine("console writeline output console writeline output

console
> writeline output " & i)
> Next
>
> If I make another simple project with a form and do Console.Writeline on a
> button click, none of the output shows up until the application exits. And

if
> this output exceeds a ciritcal limit, it hangs just like in the first

project.
>
> I'd really like to know what's up with this one. But if no one else can
> reproduce it, maybe I'll just have to reinstall VS.
>
> Bob
>



  Reply With Quote
Old 03-02-2004, 06:07 PM   #5
Bob
Guest
 
Posts: n/a
Default Re: Console.Writeline() hangs IDE?

927 is the magic number.

This is not a new installation, yet it just started happening recently.

Bob

Module Main

Public Sub Main()
Dim test As String = New String("X"c, 927)
Console.WriteLine(test)
End Sub

End Module


"Tom Leylan" <gee@iamtiredofspam.com> wrote in message
news:OReGn%23m6DHA.2952@tk2msftngp13.phx.gbl...
> Bob,
>
> Rather than play the "hit or miss" game... test your theory by instantiating
> various string with a fixed number of characters such as: Dim test As String
> = New String("X",2048) Choose a large value (20 times the length of your
> current string for instance) and see if it is in fact the length of the
> output. Then reduce the value by half until it doesn't fail. You should be
> able to hit the exact length if that is a factor.
>
> What it sounds like (but who knows what it really is) is that the output is
> being redirected to some device (like an empty parallel or serial port) and
> when that buffer gets full the process blocks waiting for acknowledgement.
>
> Did it ever work? Did it just start doing it out of the blue or is this a
> recent installation?
>
> Tom


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off