Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Black screen disappears too quickly if there are errors

Mccombs_Tech_Supppor
2,207 Views
Hi,

We have a faculty member who is running into the following problem:

"the black screen that comes up when a program is run disappears quickly from the monitor if there is an error in the program (for example, if I try to compute the logarithm of a negative number). The problem is that the black screen contains the traceback of errors through the various subroutines that are called. Unfortunately, I cant read the traceback of errors and copy it down before the black screen disappears. This makes debugging very difficult. On my current computer, the black screen stays on the monitor even if there is an error."

We're pretty sure that it's some setting somewhere, but don't knwo what we need to be looking for.

Any help would be much appreciated.

Thank you!
0 Kudos
5 Replies
Steven_L_Intel1
Employee
2,207 Views
The "black screen" is the console window. If you are running from inside Visual Studio and select "Start without debugging", then the window will indeed stay up until a key is pressed. If you start the program with debugging, then as soon as the program exits, Windows closes the console window. Also, if you run the program by double-clicking on the EXE, the window will disappear when the program exits. I am not aware of a setting that controls this.

There are a couple of things one can do. One is to use "Start without debugging" in Visual Studio. Another is to open a command prompt window and run the program from there. If you run under the debugger and an error occurs, the debugger should stop at the point of the error.
0 Kudos
IanH
Honored Contributor III
2,207 Views
There are some exceptions with "Start without debugging" where the console will still close immediately when the program exits (no "press enter to continue" type message). These exceptions can be associated with the program trying to report an error (perhaps from user code, rather than the runtime).

In this case, or for end users not running under VS, starting the program from an existing console window or shortcut or batch file might be the go.
0 Kudos
bmchenry
New Contributor II
2,207 Views
One other alternative is to peace pipe it!
Piping the output to a file might salvage the error messages.
open a cmd window
use the '>' command to pipe to a file
for example, if your program is 'MyProgram'
simply enter in the cmd window

MyProgam > Myprogram.txt

then all output will be piped to file MyProgram.txt in the program diretory.

0 Kudos
tropfen
New Contributor I
2,207 Views
Hello,

i have also seen this behavior. It is not nice...

Usely this is based to operations like sqrt(-xx).

But it would be nice that the window would stay.

The effect is not stable. We were not able to reproce it by intention.

Frank
0 Kudos
Mccombs_Tech_Supppor
2,207 Views
We have some additional information from the faculty member on the issue:

I ran a program using Start without debugging that has an error in it on line 52 (in the case below, the program is trying to compute the log of a negative number). I need the black screen below with the error trace back information to stay up.

<>

The Miscellaneous.exe has stopped working dialog box below appears with the Cancel button in the lower right hand corner at the same time the black screen appears. If I click on the Cancel button, the black screen disappears.

<>

If I wait approximately 60 seconds, the dialog box changes to the one below with the Debug and Close Program buttons in the lower right hand corner. If I click on Debug then I get the screen on the next page.

<>

<>

If I now click on No the black screen stays up.

My question is: Do you know how to get rid of the Miscellaneous.exe has stopped working dialog box. This did not show up when I was running programs on my old computer [NOTE FROM US: same operating system, but running previous version of compiler and VS2007]. On my old computer when a program stopped working, it went straight to the dialog box immediately above this paragraph.

Thank you for everyone's feedback on this!
0 Kudos
Reply