RE:CINT debug capabilities

Patrick Decowski (decowski@mit.edu)
Thu, 18 Feb 1999 13:25:16 -0500 (EST)


dear masa,

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. 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.

my favorite example and one that many users seem to make is:

//
// sec.C
{
gROOT->Reset();

TCanvas c("aapje");

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.

CINT/ROOT C/C++ Interpreter version 5.13.83, Dec 2 1998
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
Private parts loaded...
root [0] .x sec.C

*** Break *** segmentation violation

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

root [1] #pragma security level1
root [2] .x sec.C
cint: Security mode 0xff:0x8 Assignment to pointer from different type
protected FILE:/home/decowski/Root/./sec.C LINE:8
*** Interpreter error recovered ***
root [3]

therefore my question is, could you describe what the various security
levels are and what the restrictions of these levels are?

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?

cheers,
patrick.

-------------------------------------------o-------------------------------
Patrick Decowski |
24-504 | Home: (617)625-9352
Massachusetts Institute of Technology | Office: (617)253-9735
77 Massachusetts Ave | Fax: (617)253-1755
Cambridge, MA 02139-4307 |
-------------------------------------------o-------------------------------
http://web.mit.edu/decowski/www/home.html | e-mail: decowski@mit.edu
-------------------------------------------o-------------------------------