Problem with TASImage in PyROOT

All,
I am trying to compile and install ROOT from source, but I’m having a problem with TASImage in PyROOT. I am currently working with ROOT version 5.16.00, but have tried 5.18.00 with a similar problem. To compile, I do the following:

> ./configure --prefix=/usr/local \
--enable-python \
--enable-minuit2 \
--enable-roofit \
--enable-unuran \
--with-python-incdir=/usr/include/python2.5
--with-python-libdir=/usr/lib

> sudo make
> sudo make install

When everything is finished I can run ROOT’s Cint with the following commands

root [1] im = new TASImage("foo.png");
root [2] im.Draw()

and the .png is drawn on a new canvas as expected. However, if I try to do the same thing in Python, I get

Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from ROOT import TASImage
>>> im = TASImage("foo.png")
>>> im.Draw()
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
Attaching to program: /proc/29599/exe, process 29599
[Thread debugging using libthread_db enabled]
[New Thread -1210111808 (LWP 29599)]
(no debugging symbols found)...done.
(no debugging symbols found)...done.
done.
done.
done.
done.

0xffffe410 in __kernel_vsyscall ()
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /proc/29599/exe, process 29599
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/root/ROOT.py", line 341, in __getattr1
    self.__finalSetup()
  File "/usr/local/lib/root/ROOT.py", line 384, in __finalSetup
    if c.CreatePyROOTApplication():
SystemError: problem in C++; program state has been reset

So far, the problem only manifests itself with TASImage. Everything else I’ve tried to do in Python, including TGraph, TH2I, etc., has worked flawlessly. I’m currently trying to compile on an Ubuntu Gutsy installation with gcc-4.1.3, but I’ve tried the same thing on CentOS 4.4 with similar results. I’ve also tried switching compilers from gcc-4.1.3 to gcc-3.4.6 and got a similar result, although the error occurs on the import step in that case.

I’ve been able to make this work successfully on my Gutsy box by using the ROOTv5.17 package available from Christian Holm, so I know a solution exists. For various reasons, I need to be able to compile from source, though, and I’m running out of ideas. Does anyone have any other suggestions?

Thanks,
A.J.

A.J.,

according to your python traceback, the crash is in a C++ method that is called from __finalsetup(). The odd thing, though, is that that function is called on the first line:

[quote]>>> from ROOT import TASImage[/quote], and will not be called beyond that. So, that’s rather puzzling.

Can you run with envar LD_DEBUG=files, to see whether it happens during the loading of libThread.so?

Cheers,
Wim

P.S. I couldn’t reproduce the problem on my SuSE box.