ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] I: illegal RPATH: relative paths
Date: Mon, 12 Dec 2011 18:12:01 +0400
Message-ID: <20111212141201.GC24413@altlinux.org> (raw)
In-Reply-To: <20111212134733.GB24413@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 4301 bytes --]

Hi,

On Mon, Dec 12, 2011 at 05:47:33PM +0400, Dmitry V. Levin wrote:
> Анализ логов тестовой пересборки показывает, что в Sisyphus-x86_64 очень много
> пакетов с ошибочными и/или некорректными RPATH.
[...]
> - относительные пути вместо абсолютных;

Относительные пути вместо абсолютных в RPATH - это беда.
Вот как это выглядит на простом примере.

Обычная простая программа без RPATH:
$ echo 'int main(void){return 0;}' |gcc -xc - -O2 -Wall -o a.out && strace -eopen ./a.out
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libc.so.6", O_RDONLY)      = 3
+++ exited with 0 +++

Та же самая программа, но с RPATH, содержащим относительный путь:
$ echo 'int main(void){return 0;}' |gcc -xc - -O2 -Wall -o a.out -Wl,-rpath,foo && strace -eopen ./a.out
open("foo/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("foo/tls/libc.so.6", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("foo/x86_64/libc.so.6", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("foo/libc.so.6", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib64/libc.so.6", O_RDONLY)      = 3
+++ exited with 0 +++

Как видно, относительный путь в RPATH приводит к тому, что ld.so во время
запуска программы ищет все слинкованные библиотеки относительно текущего
каталога, т.е. в совершенно непредсказуемых местах.

Как правило, относительные пути в RPATH - это просто ошибки сборки.
Вот, например, самая распространенная из таких ошибок в Sisyphus-x86_64:
$ lftp -c 'cat http://git.altlinux.org/beehive/logs/Sisyphus-x86_64/latest/success/CoinSYMPHONY-5.4.1-alt1.svn20110903' | grep RPATH
verify-elf: WARNING: ./usr/bin/symphony: RPATH entry found: path=/usr/lib/openmpi/lib
verify-elf: WARNING: ./usr/lib64/libSymAppl.so.0.0.0: RPATH entry found: path=/usr/lib/openmpi/lib
verify-elf: WARNING: ./usr/lib64/libOsiSym.so.0.0.0: RPATH entry found: path=/usr/lib/openmpi/lib
verify-elf: WARNING: ./usr/lib64/libSym.so.0.0.0: RPATH entry found: path=/usr/lib/openmpi/lib
Скорее всего, мейнтейнер имел в виду "/usr/lib/openmpi/lib", а вовсе не
"path=/usr/lib/openmpi/lib", который у него получился.

Вот список исходных пакетов с относительными путями в RPATH на x86-64,
в формате ACL:

CoinBcp	real @everybody
CoinBcps	real @everybody
CoinBlis	real @everybody
CoinBonmin	real @everybody
CoinCgl	real @everybody
CoinClp	real @everybody
CoinDip	real @everybody
CoinFlopCpp	real @everybody
CoinMP	real @everybody
CoinOS	real @everybody
CoinSYMPHONY	real @everybody
CoinSmi	real @everybody
CoinVol	real @everybody
GASNet	real @qa @everybody
adios	real @everybody
afepack-complex	real @everybody
afepack-real	real @everybody
arpack	real @qa @everybody
blopex-complex	real @everybody
blopex-real	real @everybody
blzpack	real @qa @everybody
ccaffeine	real sin @python @qa @everybody
cheetah	real @qa @everybody
chicken	voins oddity
dsdp	real @qa @everybody
exodusii	real @everybody
gromacs	mike @qa @everybody
h5part-mpi	real @everybody
ibutils	stanv inger real @qa
katrin	zver @qa
libblacs	real @qa @everybody
libhdf5-7-mpi	real @everybody
libnetcdf7-mpi	real @everybody
libproxy	shaba aris @gnome
libscalapack	real @qa @everybody
mISDN	mithraen
mct	real @qa @everybody
mpe2	real @qa @everybody
mpip	real sin @python @qa @everybody
mpitests	real @qa @everybody
mumps	real @qa @everybody
p4est	real @everybody
parmetis0	real @everybody
pastix	real @qa @everybody
petscfem-complex	real @everybody
petscfem-real	real @everybody
primme	real @qa @everybody
pswarm	real @python @qa @everybody
pympi	real @qa @python @everybody
python-module-boostmpi	real @everybody
python-module-mpi4py	real sin @python @qa @everybody
salsa-complex	real @qa @everybody
salsa-real	real @qa @everybody
scalasca	real @qa @everybody
scotch	real @qa @everybody
scribus	manowar real @everybody @qa
silo	real sin @python @qa @everybody
spooles	real @qa @everybody
sprng	real @qa @everybody
sprng1	real @everybody
squid-kerberos-ldap-helper	manowar @qa
sundials	real @qa @everybody
trlan	real @qa @everybody

Я предлагаю считать относительные пути в RPATH грубыми ошибками,
приводящими к ошибке сборки даже в режиме проверки rpath=relaxed.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-12-12 14:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 13:47 [devel] I: illegal RPATH, introduction Dmitry V. Levin
2011-12-12 14:12 ` Dmitry V. Levin [this message]
2011-12-12 18:01   ` [devel] I: illegal RPATH: relative paths Igor Vlasenko
2011-12-13  3:40     ` REAL
2011-12-13  4:18       ` Damir Shayhutdinov
2011-12-13  5:52         ` REAL
2011-12-13  6:50           ` Damir Shayhutdinov
2011-12-13  7:56             ` REAL
2011-12-13 11:06               ` Dmitry V. Levin
2011-12-13 12:11                 ` REAL
2011-12-13 17:24               ` Michael Shigorin
2011-12-13 11:30     ` Dmitry V. Levin
2011-12-13 12:33       ` REAL
2011-12-13 16:01       ` Dmitry V. Levin
2011-12-13 16:11         ` Денис Смирнов
2011-12-13 16:46           ` Damir Shayhutdinov
2011-12-14  6:44             ` Денис Смирнов
2011-12-14  8:53               ` Sergey Y. Afonin
2011-12-14 10:07                 ` REAL
2011-12-14 11:09                   ` Michael Shigorin
2011-12-14 12:11                     ` REAL
2011-12-13 17:25       ` Michael Shigorin
2011-12-13 17:32         ` Dmitry V. Levin
2011-12-13 19:17           ` Michael Shigorin
2011-12-13 21:29       ` Dmitry V. Levin
2011-12-13  3:37   ` REAL
2011-12-21 10:55   ` Michael Shigorin
2011-12-31 15:43     ` Yuri N. Sedunov
2011-12-12 14:33 ` [devel] I: illegal RPATH: out of standard library tree paths Dmitry V. Levin
2011-12-13  3:43   ` REAL
2011-12-13 11:17     ` Dmitry V. Levin
2011-12-13 12:25       ` REAL
2011-12-12 14:57 ` [devel] I: illegal RPATH: paths to standard libraries Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111212141201.GC24413@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git