Page 2 of 2

Re: Reinitializing LXTerminal without Rebooting

PostPosted: July 13th, 2017, 9:28 am
by asheets
Not what I was expecting.... back to the drawing board...


evansste wrote:After running the short program overnight, LXterminal stopped working, as expected. <snip>

Re: Reinitializing LXTerminal without Rebooting

PostPosted: July 15th, 2017, 5:06 am
by bandersnatch
Hi Guys,

It's only a hunch but I suspect that the problem lies with the octave-cli script rather than in LXTerminal.
I agree with the comment from asheets that the shell script hangs due to a resource lack/conflict but
I reckon that this is caused by Octave/the Octave script...
Analysing the shell/process structure from the OS level might not give you enough information

Two approaches come to mind:
1/ Embed debugging logging in the Octave script to log execution of the script to a file.
With any luck you will see exactly where/why the script is hanging....
Start with coarse-grained logging & add more fine-grained logging when you know approximately where things are clogging up...

2/ Just out of curiosity, you could also set up Octave on an (e.g.) XP virtual machine (VMWARE/Virtual box.. whatever)
& see if you get the same problem with hanging after 24 hours.
If this also hangs then the problem is definitely in Octave/the Octave script & not LXTerminal/Lubuntu
If the script runs stably under XP then the problem is truely with lubuntu & we are "back to the drawing board"..;^)

You can also use the XP system monitor to track/graph the memory/io/processor usage of the script over days/weeks..
These graphs provide a quick and easy way of monitoring/examining the resource usage & trends of your Octave script.
If you see a curve that keeps rising then you can be sure that things will eventually come to a grinding halt.

The idea is to use the powerful monitoring tools in XP to tune your Octave script so that it remains stable in your lubunti enviroment..
The XP kernel is heavily influenced by VMS, and has hugely extended kernel monitoring features compared to the original Unix kernel...

Keep us posted on your progress ;^)

STFB.

Re: Reinitializing LXTerminal without Rebooting

PostPosted: July 15th, 2017, 6:29 am
by evansste
Hello everyone.

Duplicating this scenario is extremely easy, and knowing what I did, specifically, may allow you to see the problem right away.

First, open octave. I always use the console, so I open LXterminal and type "octave-cli".

Then modify your .octaverc file by adding "exit;" to it. When finished, mine contains the following lines:

cd /home/evansste/octdir
page_screen_output(0);
page_output_immediately(1);
exit;

Finally, type the following at the Octave prompt:

while 1;system('lxterminal -e octave-cli');pause(3);end

Once you hit "enter", Octave will open a new LXterminal every three seconds. The new terminal will immediately close. If you run this for a while, LXterminal will no longer work correctly. Opening a new LXterminal will mean opening a window that is blank. For me, I let it run overnight. The next morning, LXterminal wasn't working correctly.

The above is all I needed to do in order to re-create the situation. Maybe this will help you understand what the problem is.

Re: Reinitializing LXTerminal without Rebooting

PostPosted: November 8th, 2017, 3:24 am
by ElizabethMireles
Hello there! Thanks for sharing this individual opinion with us! This process requires a total overhaul, as for me.

Re: Reinitializing LXTerminal without Rebooting

PostPosted: November 9th, 2017, 10:53 am
by evansste
ElizabethMireles, when you say "total overhaul", you're saying that you have to reboot too?

I'm learning that many of these programs, like LXTerminal, work fine when you use them the way they're expected to be used. For instance, I'm sure the creators of Lubuntu and LXTerminal never anticipated a scenario where LXTerminal would be opened and closed, via an automated process. When LXTerminal isn't being opened and closed hundreds of times by another program, it works fine.

I bring up Lubuntu because many of the tasks I perform with my computers, puts a heavy burden on the operating system (In my case, Lubuntu). Rather than familiarize myself with popular parallelization tools, like POSIX and OpenMP, I chose to use basic tools provided by Octave and the operating system. I've written programs that use LXTerminal in an automated way, or programs which write and pass files in an automated way. As a result, the operating system does all of the work. It starts and runs these multiple programs via separate Octave sessions. In theory, everything should work with no problems. However, it puts a big strain on the operating system, and tests its limitations. As a result, sometimes things don't work the way they're supposed to.

My most recent problem is with Octave's "exist" function. It seems to work fine when you use it in order to see if a particular file exists. However, when multiple programs are checking the existence of multiple files, all at the same time, the operating system has to coordinate everything. In extreme cases, every once in a while, "exist" says that a file exists when it really doesn't. This then causes all sorts of problems.

The common denominator is that in all of these cases, the operating system is working hard to coordinate lots of tasks -- probably more tasks than it's usually expected to handle. So maybe the operating system is the culprit when it comes to LXTerminal failing to work correctly in these extreme cases. This is just a hunch that I have.