RE:CINT debug capabilities

Masaharu Goto (MXJ02154@nifty.ne.jp)
Fri, 19 Feb 1999 22:54:42 +0900


Patrick,

Thank you for specifying the problem in detail.
I can improve CINT with this kind of feedback

>i was wondering if you could elaborate more on the 'security' features
>of CINT. there are five settings, the default setting seems to be 0
>and most liberal and anything above level 4 gives 'Warning: Security
>level4 only experimental, High risk'. i would love to bump up the
>security level to something higher than 0.

Please refer to src/security.h. There described security mode flag definition.
G__SECURE_LEVEL[0-6] corresponds security flag bit assignment of
'#pragma security level[0-6]'.
G__SECURE_STACK_DEPTH to G__SECURE_SECURE_STANDARDLIB represents meaning of
each bit.

I'm sorry but I need to say that the CINT security mode is not usable in ROOT.
It is created before ROOT/CINT integration and has no ROOT related
consideration. The idea of CINT security mode is to restrict C++ syntax,
such as pointer and pointer arithmetic, in order to make the environment
a little more robust. Unfortunately, this concept was not successful and
does not match at all with ROOT framework.

>i think that many of the
>users of ROOT/CINT are novice C++ programmers and are astonished that
>code that did run in script mode does not compile. having a more
>restrictive environment (such as pointing out that '->' is not equal
>to '.') would also solve some subtle problems. i personally don't care about
>saving a few keystrokes (2 vs. 1 in the above example) unless you know
>what you are doing.

Under such situation, I agree with you. CINT is in favor of sloppy scripting.
As long as the meaning is understandable, it accepts wrong syntax. This is
a design philosophy issue. Whether to take strictness or sloppiness.
It is possible to display warning message. The problem is transition to
new behavior. Some people will be surprised by the warning message which
did not come up before. Need to think how to avoid confusion.

Rene, how do you think about Patrick's comment?

>my favorite example and one that many users seem to make is:
> TLine *line = TLine(0, 0, 0.5, 0.5); // note: missing 'new'
> line->SetLineColor(4);
> line->Draw();
>with the default security setting, you get a SEGV in the
>'line->Draw()' line, but not in the 'line->SetLineColor(4)' line.

Thank you for reporting this. I fixed this so that the missing 'new'
becomes an error.

>bumping the security up to level1, does exactly what i want:

So, the problem is avoided without using security level1.
Drawback is that you could have memory leak if you see the error message.

>unfortunately, including the '#pragma security level1' statement in my
>.rootlogon.C does not increase my default security level, it remains
>at 0. is this set to a default value in ROOT after processing the
>.rootlogon.C scripts?

I think security level is reset after rootlogin.C.

Masaharu Goto