Issue with running program with Run gives different results from Debug.

Answered

I'm running on Arch Linux with CLion 2016.1. I'm using TinyXML2 to develop my program and in the parts of code responsible for parsing TinyXML2 CLion just stops printing to screen after awhile while running with run. For testing I'm compiling under the release setting.

If I run it as Debug the entire xml document gets parsed. If I run the program from the terminal in the folder the release binaries get generated at it parses the entire document. It just stops mid way through a string if I use Run in CLion to run the program.

Are there any ideas as to what could be going on?

6 comments

I also have the project configured to use the bundled cmake and gdb.

0

I created an ouput.txt file that just saved all of the text cout was supposed to print to a file, and everything is there even though CLion stops printing after a certain point. I think it is just a configuration I need to change in CLion.

Is there anyway to get CLion to keep printing under Run?

0

Hi Michael.

Please try using the latest CLion 2016.1.2 which contains the fix for the problem. Does that help?

0

After a reboot the issue seems to be mostly fixed. I only noticed output being lost 1 out of about 20 runs.

0

i have same types of problem

1. Run "project" just stop printing text in half a way .. (no matter if it is between two commands or in a part of string in cout)

2. Run give different results than Debug 

Run: 

Debug:

code (please, pardon me for using Czech names for atributes, but this is my school project) 

how you can notice .. problem should be with std::cin command :

void RegistrUzivatelu::logUzivatel() {
std::string jmenoUzivatele;
std::cout<<"zadej jmeno Uzivatele"<<std::endl;
std::cout<<"3"<<std::endl;
std::cin>>jmenoUzivatele;


for(int i =0; i<s_uzivatele.size();i++){
std::cout<<"3.5"<<std::endl;
if (jmenoUzivatele==s_uzivatele.at(i)->getJmeno()){

s_aktualniUzivatel=s_uzivatele.at(i);
break;
}
};

 ps . in static vector there is only one object 

0

Hello, @Vojtab42!

What toolchain do you use - MinGW or Cygwin? In our tracker we have the issues which look related: https://youtrack.jetbrains.com/issue/CPP-37876, https://youtrack.jetbrains.com/issue/CPP-2580. Please follow them to get updates. But these problems most likely are MinGW-only. So if you're using MinGW, you can try switching to Cygwin.


If this is not possible, then please try disabling PTY: go to Help | Find Action, type "Registry...", select it and in the opened list find and disable option run.processes.with.pty (don't restart CLion after that). Does it help to get the full output?


Please note the run.processes.with.pty option is not saved after CLion's restart and should be disabled again every time you open CLion (if you need it to be disabled). We have the issue in our tracker about that: https://youtrack.jetbrains.com/issue/CPP-8395.

0

Please sign in to leave a comment.