TPython::Prompt() problem since ROOT 5.25.02

Hi,

TPython::Prompt() in ROOT 5.25.02 and later would crash whenever an input is entered under python prompt “>>>”.

[quote]root [0] TPython::Prompt();

print 2

*** Break *** segmentation violation

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#10 0xf547840e in call_readline (sys_stdin=0xf7022420, sys_stdout=0xf70224c0,
prompt=0xf543b174 ">>> ") at /build/LCG/Python-2.5/Modules/readline.c:890
#11 0xf5d300cb in PyOS_Readline (sys_stdin=0xf7022420, sys_stdout=0xf70224c0,
prompt=0xf543b174 ">>> ") at Parser/myreadline.c:208
#12 0xf5d31390 in tok_nextc (tok=0x9961130) at Parser/tokenizer.c:779
#13 0xf5d31b3c in PyTokenizer_Get (tok=0x9961130, p_start=0xffc70bf4,
p_end=0xffc70bf8) at Parser/tokenizer.c:1126
#14 0xf5d2d4e3 in parsetok (tok=0x9961130, g=, start=256,
err_ret=0xffc70c40, flags=) at Parser/parsetok.c:135
#15 0xf5dd05d6 in PyParser_ASTFromFile (fp=0xf7022420, filename=0xf6cab78c “”,
start=256, ps1=0xf543b174 ">>> ", ps2=0xf5434df4 "… ", flags=0xffc70cf8,
errcode=0xffc70cb8, arena=0x9c033d8) at Python/pythonrun.c:1373
#16 0xf5dd1503 in PyRun_InteractiveOneFlags (fp=0xf7022420,
filename=0xf6cab78c “”, flags=0xffc70cf8) at Python/pythonrun.c:763
#17 0xf5dd171b in PyRun_InteractiveLoopFlags (fp=0xf7022420,
filename=0xf6cab78c “”, flags=0xffc70cf8) at Python/pythonrun.c:714
#18 0xf6c95883 in TPython::Prompt ()
from /afs/usatlas.bnl.gov/cernsw/lcg/app/releases/ROOT/5.25.04/slc4_ia32_gcc3
4/root/lib/libPyROOT.so

[/quote]

I tried ROOT 5.25.02, 5.25.04 and 5.26.00, the same problem. But there is no such a problem with ROOT 5.24.00. I noticed one difference between version 5.24.00 and the others. In 5.24.00, the “TPython::Prompt()” is shown in mono, while in 5.25.02 and the others it is shown in color, something like “[color=blue]TPython[/color]::Promptcolor=cyan[/color]”.

–Shuwei

Shuwei,

works fine for me … which platform are you running on, and is “editline” enabled (it is by default)?

Cheers,
Wim

Hi Wim,

I am running in SL©5. I also tried SL4 at BNL and SLC5 at CERN, the same problem.

What is “editline”? And how to check if it is enabled? By the way the same python is used for ROOT 5.24.00 and 5.25.04.

–Shuwei

Shuwei,

“root-config --config” will yield the configure CLI options, and yes, editline is enabled. At issue is that editline is a readline alternative (different license) and it duplicates several symbols (there’s a readline.cxx in root/core/editline/src). Presumably they clash.

Since editline is inside libCore.so, its loading can’t be helped, meaning that the only solution I can see is to strip readline out of ROOT.py (which also means that there’s no python-side line editing available).

Right now, I can’t think of a better answer …

Cheers,
Wim

Hi,

I’ll try to hide these symbols, they need not be accessible outside libCore anyway. Will post when done.

Cheers, Axel.

Hi,

fixed in v5-26-00-patches and the trunk. Thanks for your report and Wim’s diagnosis!

Cheers, Axel.