TRint error

Hi,

I have posted this request already in nov. 2004 but it is still not fixed in version 4.04.00. Could anyone please fix that.

If you run the following code and type .q the interpreter is not terminated correctly. The while(true) loop is still interpreting keyboard input.

#include <TRint.h>
int main(int argc, char *argv[])
{
TRint *app = new TRint(“App”, &argc, argv,NULL,0,true);
app->Run(true);
while(true) {}
return 0;
}

Thanks for help,

Matthias

Hi,

I do not know what you mean by[quote]The while(true) loop is still interpreting keyboard input. [/quote]When I try your code I see

root [0] .q root [1]Possibly the last ‘root [1]’ is spurrious. But (as evidenced by the stack trace when running the debugger) the process is then in the infinite while loop. If your press CTRL+C, then you are triggering the signal handler of ROOT which will print yet another spurrious ‘root >’. However there is still NO interpreting of the keyboard output. What are you trying to do? You may simply have to disable/unload the ROOT signal handler once TRint::Run returns.

Cheers,
Philippe.

Hi,

Ok, I am working on windows, I have noticed that on linux the program behaves different.

Your right on linux there’s no interpretation. But there’s the same bug too. It just behaves different.

First you can try the code from the previos mail on windows. What you get is the following :

root [0] .q
root [1] qqq
Error: Symbol qqq is not defined in current scope FILE:(tmpfile) LINE:1
*** Interpreter error recovered ***

The first thing which goes wrong is that I should not be able to type qqq on the inputline. Then the root interpreter still analysis the input and writes an error message.

After I quit the root interpreter by typing .q I would actually expect the root interpreter to stop completely.

On linux try this code :

#include <TRint.h>
int main(int argc, char *argv[])
{
char xx[100];
TRint *app = new TRint(“App”, &argc, argv,NULL,0,true);
app->Run(true);
while(true) {
cin >> xx;
cout << xx << endl;
}
return 0;
}

Type .q. Then type some input for the cin statement. This input will not be written out because the root interpreter steals the input.

So after quitting the root interpreter the IO is a complete mess.

To me it looks like some input handle thread is still running and blocks the cin statement.

Matthias

Hi,

The problem should now be corrected in the CVS repository.

Cheers,
Philippe.