Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 287178 - sci-physics/root with --as-needed => runtime freeze
Summary: sci-physics/root with --as-needed => runtime freeze
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Science Physics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-30 23:02 UTC by Andrew Savchenko
Modified: 2010-06-16 15:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
test sample (test.root,73.65 KB, application/octet-stream)
2009-10-09 19:31 UTC, Andrew Savchenko
Details
strace output of freeze (root.strace,1.16 MB, text/plain)
2009-10-09 19:45 UTC, Andrew Savchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2009-09-30 23:02:07 UTC
Hello,

for both 5.22.00-r2 and 5.24.00 with the latest --as-needed from bug 280925 compiled with -Wl,--as-needed at LDFLAGS I encounter runtime freeze after the following actions:

1) ran root as usual without any macro or data files on CLI:
$ root -l
2) Create TBrowser object:
new TBrowser
3) Open a root file with TTree in it.
...and root freezes, both TBrowser and CINT interpreter.

If I recompile without --as-needed it works ok.
I reemerge my whole tree with --as-needed via LDFLAGS, but this doesn't help.
If one run root with data file specified on CLI, TBrowser works ok and you can view specified file or open other files as well.

I suspect CINT + --as-needed problems, maybe CINT was not designed to work with --as-needed due to run-time linking issues. But I am not sure and I have no any clue on how to handle this.

If someone can confirm this bug, it would be a good idea to disable --as-needed for this package. I can upload a sample file if someone is interested in.


Just in case if anyone wonder, my emerge --info:
Portage 2.2_rc41 (default/linux/x86/2008.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30.4-hitomi i686)
=================================================================
System uname: Linux-2.6.30.4-hitomi-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 21 Sep 2009 09:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p33
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r1, 3.1.1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.6.3, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=core2 -m32 --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -mfpmath=sse -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -m32 --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -mfpmath=sse -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests ccache collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=core2 -m32 --param l1-cache-line-size=64 --param l1-cache-size=32 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -mfpmath=sse -pipe"
GENTOO_MIRRORS=" ftp://bircoph/distributive/gentoo/portage ftp://orionis/distributions/1Linux/gentoo/portage http://mirror.yandex.ru/gentoo-distfiles  ftp://ftp.corbina.net/pub/Linux/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo http://mirror.netcologne.de/gentoo"
LANG="en_US.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en ja"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/science /usr/local/portage/layman/java-overlay /usr/local/portage/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi adns afs aften aim alsa amr amrnb amrwb ao audiofile bash-completion bcmath binfilter blas bluetooth branding bzip2 cairo calendar canna caps ccache cddb cdinstall cdparanoia cdr chasen cjk cli clisp colordiff cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx cyrillic dbus device-mapper dga dia dirac directfb djvu dmx doc dri dts dv dvd dvdr dvdread dvi eap-sim editor elf encode enscript ermt examples exif expat faac faad fbcon festival ffmpeg fftw firefox flac fontconfig foomaticdb fortran fpx freetds freetype ftp gcj gcrypt gd gdbm geoip ggi gif gimp ginac git glibc-omitfp glut gmp gnuplot gnutls gpgme gphoto2 gpm gps graphviz gs gsl gsm gtk gucharmap h224 h281 h323 hdf5 hdri iceweasel iconv icq icu id3tag idn imagemagick imap imlib immqt-bc inkjar ipod iproute2 ipv6 isdnlog jabber jack jadetex java6 javascript jbig jingle jpeg jpeg2k kdehiddenvisibility kerberos keyscrub kpathsea kqemu ladspa lame lapack lash latex lcms ldap libcaca libnotify libsamplerate libwww logrotate lzo mad maildir mailwrapper matroska mbox md5sum mhash mikmod mime mjpeg mmap mmx mng modplug mp3 mpeg mplayer mppe-mppc msn mudflap musepack musicbrainz mysql mysqli nas ncurses netcdf network network-cron nls nntp nocd nodrm nptl nptlonly nsplugin nuv objc objc++ offensive ogg openal openexr opengl openmp oscar otr pam pango pcntl pcre pda pdf perl pgf plotutils png pop posix postproc postscript ppds pppd pronounce pstricks pth qt3 qt3support qt4 quicktime raw rdesktop readline recode reflection restrict-javascript rle rrdtool samba savedconfig scanner schroedinger sdl session sharedmem shorten sip sipim slang slp smi smime smp sms smtp sndfile sockets socks5 soundtouch sox sparse speex spell spl sqlite sqlite3 sse sse2 sse3 ssl ssse3 startup-notification subversion supernodal svg svga sysfs syslog szip t1lib taglib tcpd theora threads tiff timezone timidity tordns truetype twolame type3 unicode usb v4l v4l2 vamp vcd vhook videos vim vim-syntax vnc vorbis wav wavpack wifi win32codecs wireshark wmf x264 x86 xattr xcb xface xft xinerama xorg xosd xpm xprint xrandr xscreensaver xv xvid yahoo yaz ziffy zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authz_host dir mime" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en ja" USERLAND="GNU" VIDEO_CARDS="intel vesa fbdev"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2009-10-01 09:29:16 UTC
I will wrangle your bug but please be sure it's valid! Did you test it with more _sane_ C{XX}FLAGS?
Comment 2 Andrew Savchenko gentoo-dev 2009-10-01 21:18:03 UTC
(In reply to comment #1)
> I will wrangle your bug but please be sure it's valid! Did you test it with
> more _sane_ C{XX}FLAGS?

OK, I tested it with CFLAGS="-O2 -march=core2" and CXXFLAGS=${CFLAGS} (root will not compile with -march=i386).

And of course, nothing changed: it freezes with --as-needed and works OK without it. On my first posting I thought provided arguments are more than enough to convince that this is --as-needed triggered issue.
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2009-10-02 17:28:54 UTC
(In reply to comment #0)
> Hello,
> 
> for both 5.22.00-r2 and 5.24.00 with the latest --as-needed from bug 280925
> compiled with -Wl,--as-needed at LDFLAGS I encounter runtime freeze after the
> following actions:
> 
> 1) ran root as usual without any macro or data files on CLI:
> $ root -l
> 2) Create TBrowser object:
> new TBrowser
> 3) Open a root file with TTree in it.
> ...and root freezes, both TBrowser and CINT interpreter.

Sorry I haven't use root for a while. Could you provide the exact test you did and with the file and the use flags, so I can reproduce?
Thanks.
Comment 4 Markus Dittrich (RETIRED) gentoo-dev 2009-10-03 01:38:03 UTC
I fail to see how -as-needed can be the root cause
for this since it only affects the linker (unless it
is a linker bug). Could you provide the strace output
so we can see what root is doing.

Thanks,
Markus
Comment 5 Andrew Savchenko gentoo-dev 2009-10-09 19:31:49 UTC
Created attachment 206577 [details]
test sample

Hello,

(In reply to comment #3)
> Sorry I haven't use root for a while. Could you provide the exact test you did
> and with the file and the use flags, so I can reproduce?
> Thanks.

Test file is attached. Steps to reproduce:
1) 
root -l
root [0] new TBrowser
2) Open test.root via TBrowser interface, then root freezes in my case.

Here are my use flags for root:
cern clarens doc examples fftw geant4 math mysql pythia6 pythia8 python qt4 reflex ssl xml xrootd -afs -cint7 -debug -emacs -kerberos -ldap -odbc -openmp -oracle -postgres -ruby -xinetd
Comment 6 Andrew Savchenko gentoo-dev 2009-10-09 19:45:16 UTC
Created attachment 206579 [details]
strace output of freeze

Hi,

(In reply to comment #4)
> I fail to see how -as-needed can be the root cause
> for this since it only affects the linker (unless it
> is a linker bug). Could you provide the strace output
> so we can see what root is doing.

ROOT is not just an app, it contains its own interpreter with dynamic library loading, that's why --as-needed affect it.

Another test: in my previous message I pointed out a way to reproduce a bug, but if you'll call
gSystem->Load("libTree");
in interpreter prior to creation of TBrowser object it will open sample file without a problem.

strace output is attached. One can see infinite loop in library access.
Comment 7 Sébastien Fabbro (RETIRED) gentoo-dev 2009-11-19 05:48:07 UTC
I have disabled as-needed in the just committed 5.24.00-r1.
Leaving this bug open for now.
Comment 8 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-09 20:49:16 UTC
hi

it seems that root-5.26.00-r2 does fine with as-needed. could you check on your side too, by removing the no-as-needed from the ebuild and adding it to your LDFLAGS?

thanks
Comment 9 Andrew Savchenko gentoo-dev 2010-06-10 17:30:46 UTC
Hello,

with --as-needed it is not even possible to compile root-5.26.00-r2 with the following flags:
USE="afs clarens doc examples fftw geant4 kerberos math mysql opengl pythia6 pythia8 qt4 reflex ssl xft xml xrootd -cint7 -emacs -ldap -odbc -openmp -oracle -postgres -python -ruby -xinetd"

It fails here:
g++ -m32 -march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredicti
ve-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe -Wl,-O1 -Wl,--
as-needed ../../obj/XrdFrmAdminMain.o ../../obj/XrdFrmAdmin.o ../../obj/XrdFrmAdminAudit.o ../../obj/XrdFrmAdminFiles.o ../../obj/XrdFrmAdminFi
nd.o ../../obj/XrdFrmAdminQuery.o ../../obj/XrdFrmAdminUnlink.o ../../obj/XrdXrootdMonitor.o ../../obj/XrdScheduler.o -lreadline  -lncurses -ln
sl -lpthread -lrt -ldl -lc -L../../lib -lXrdFrm -lXrdCms -lXrdOss -lXrdNet -lXrdOuc -lXrdSys   -o ../../bin/frm_admin
../../lib/libXrdOss.a(XrdOssAio.o): In function `XrdOssFile::Fsync(XrdSfsAio*)':
XrdOssAio.cc:(.text+0x5e): undefined reference to `aio_fsync64'
../../lib/libXrdOss.a(XrdOssAio.o): In function `XrdOssFile::Read(XrdSfsAio*)':
XrdOssAio.cc:(.text+0x29c): undefined reference to `aio_read64'
../../lib/libXrdOss.a(XrdOssAio.o): In function `XrdOssFile::Write(XrdSfsAio*)':
XrdOssAio.cc:(.text+0x4d8): undefined reference to `aio_write64'
../../lib/libXrdOss.a(XrdOssAio.o): In function `XrdOssAioWait(void*)':
XrdOssAio.cc:(.text+0x93f): undefined reference to `aio_error64'
XrdOssAio.cc:(.text+0x95b): undefined reference to `aio_return64'
collect2: ld returned 1 exit status

Unresolved symbols belong to librt:
$ symlookup -qr "aio_.*64"
/lib/librt-2.11.1.so:   aio_return64
/lib/librt-2.11.1.so:   aio_cancel64
/lib/librt-2.11.1.so:   aio_fsync64
/lib/librt-2.11.1.so:   aio_error64
/lib/librt-2.11.1.so:   aio_read64
/lib/librt-2.11.1.so:   aio_suspend64
/lib/librt-2.11.1.so:   aio_write64

and -lrt is before -lXrdOss, so failure is predictable.

Without --as-needed it compiles normally.
Comment 10 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-14 19:18:04 UTC
Alright, I bumped a new revision: root-5.26.00-r3 with a big patch from upstream, more LDFLAGS propagation and as-needed fixes. Right now the ebuild allows as-needed, so please test.

Thanks.
Comment 11 Andrew Savchenko gentoo-dev 2010-06-15 21:15:24 UTC
(In reply to comment #10)

After some base tests r3 works still fine for me (with --as-needed).
Comment 12 Sébastien Fabbro (RETIRED) gentoo-dev 2010-06-16 15:40:11 UTC
> 
> After some base tests r3 works still fine for me (with --as-needed).
> 

Good. Let's close this one for now.