0
votes

I wrote a text mode batch C++ program that since today is giving me some troubles.

  • The executable worked correctly and it did not change.
  • The environment did not change; not even a reboot.
  • When I launch the program from a certain console, everything is fine.
  • When I launch the program from a new console, everything still works, but I get just the first two lines on the log file, even if the execution completes.
  • The parameters passed to the executable are the same.
  • The executable does not interact with the console in any way.
  • The two consoles' environment variables are the same.
  • When run from a remote computer as root, everything is fine, the log file is complete.
  • When logged in again with my user, from another session, everything is fine again.
  • When logging out and in again, everything is fine again.

So, could it be the from a certain instant on, the new consoles had some issues that caused this problem?

Could this be a problem of my Linux installation?

Or, more realistically, could the problem depend on my program?

Thank you!

Environment:
- Linux OpenSuse 11.4
- gcc 4.5.1

1
Perhaps showing the source code of your program could help. Did you use a debugger (like gdb) or strace to investigate? Did you try a more recent compiler (e.g. gcc 4.7) with all warnings enabled (i.e. compile with gcc -Wall -Wextra)?Basile Starynkevitch

1 Answers

1
votes

Here is another tool to throw into your debugging toolbox.

Try the command 'reset' -- read the man page for details.

In short, it resets the console to a known state. It is ... possible that your log files may contain control characters that try to interact with tty causing hard-to-trace problems.

You might also want to look at the command 'script' which captures all console activity to at et file for examination.