Error: Symbol G__exception is not defined in current scope?

Hello everyone,

I couple of weeks ago I wrote a small stand-alone simulation task. The task itself derives from CbmTask which itself derives from TTask (I hope that is enough info…). I wrote a small CINT macro that starts the task. The code compiles and I actually USED this macro a few weeks ago, all went fine.

Now I wanted to use it again, and I get the following error when running it:

Error: Symbol G__exception is not defined in current scope macro/tpc/createSpaceCharge.C:88: Error: type G__exception not defined FILE:/home/flix/simulation/fairroot/cbmsoft/pandaroot/./macro/tpc/createSpaceCharge.C LINE:88 *** Interpreter error recovered ***

Line 88 of the macro calls the Exec() function of my task. I replaced my task with another task of the framework I am working with just for testing, and all went fine. So it’s not the macro itself that’s causing the problem. Both tasks use exactly the same syntax, just do different things (… of course).

The code of the task compiles without errors or warnings (except an int - double conversion that’s absolutely fine). I run make install of course.

Apparently I have changed SOMETHING over the last weeks withour remembering it, but it surely was no operational code… probably I tried to make something “look better” or something. I am extremely annoyed by myself that i have not made a backup of the running version, but the change must have been so small that I didn’t think it could do any harm.

Can anyone please tell me what this CINT error message means? I went through the code line by line several times now, compared it with the other, running tasks and found nothing. Since it compiles perfectly fine, i really have no idea where to look now.

Thanks in advance,

Felix

Hi,

if this happened with current CVS (or 5.15.04) then I will need to fix it. What you see is CINT catching an exception and trying to re-throw it “into the interpreter”. And when re-throwing it doesn’t find the interpreted version of the exception to be thrown (G__exception).

You can #include by hand, before running your code (or within your code) to work around this problem. This should also give you the information what has happened, and where. Alternatively, you can attach gdb to root.exe (yes, “.exe”) and say “catch throw” so gdb tells you when and where an exception has been thrown.

Cheers, Axel.

My ROOT version is 5.14.00.

I included with the result that now there is no error message at all, just nothing happens and I get back to root prompt…

Should I upgrade ROOT to see what’s actually going wrong?

Hi Felix,

you could either upgrade ROOT or attach a debugger to root.exe and tell it to stop execution when an exception is thrown. The latter is probably simpler and as you write code you should know (or learn) how to use a debugger anyway :wink:

Cheers, Axel.

[quote=“Axel”]Hi Felix,

you could either upgrade ROOT or attach a debugger to root.exe and tell it to stop execution when an exception is thrown. The latter is probably simpler and as you write code you should know (or learn) how to use a debugger anyway :wink:

Cheers, Axel.[/quote]

Thanks for the help :slight_smile: In my case it’s going to be learning, but that’s always good isn’t it.

Cheers,

Felix

Sorry about reviving an old thread but if I understand this thread correctly such a thing shouldn’t happen in current ROOT versions and I have run into exactly the same, or very similar, problem with 5.18.00a (32-bit version, on lxPlus). The error message I get is

Error: Symbol G__exception is not defined in current scope :0: Error: type G__exception not defined FILE: LINE:0

and the code I run is a custom-built ROOT library loaded into a compiled macro by gSystem->Load(). Including by hand in the main source file of the library makes the problem go away.

If you need any more information, please let me know.