From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 18 Mar 2007 22:31:36 +0300 From: "Dmitry V. Levin" To: ALT Devel discussion list Message-ID: <20070318193136.GA3820@nomad.office.altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <20070313155104.738CD42C093E@ssh.git.local.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20070313155104.738CD42C093E@ssh.git.local.altlinux.org> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [devel] [git update] packages/rpm-utils: heads/master X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.9rc1 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2007 19:31:51 -0000 Archived-At: List-Archive: List-Post: --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Mar 13, 2007 at 06:51:04PM +0300, Alexey M. Tourbin wrote: > Update of /people/at/packages/rpm-utils.git >=20 > Changes statistics since `0.9.3-alt1-17-g38cd1bc' follows: > rpm-utils/filereq | 34 +++++++++++++++++++++++++--------- > 1 files changed, 25 insertions(+), 9 deletions(-) >=20 [...] > filereq: changed weak/strong access logic > =20 > Now that we have strace_files which is dumb, we can add some logic to= filereq. > Let us look at system calls that access files. > =20 > $ grep -w TF strace/linux/x86_64/* > strace/linux/x86_64/syscallent.h: { 3, TD|TF, sys_open, = "open" }, /* 2 */ [48 entries skipped] > strace/linux/x86_64/syscallent.h: { 3, TD|TF, sys_faccessat= , "faccessat" }, /* 269 */ > =20 > I discriminate a few types of system calls that produce file-level de= pendencies: > =20 > 1) Strong system calls: open and execve. They access file data and f= ollow > symbolic links. Thus, for symbolic links, we must also output the fi= le it > points to. > =20 > 2) Weak system calls: stat and access. They follow symbolic links bu= t do not > access file content. Provided that rpm packages do not have broken s= ymbolic > links, these system calls do not require special handling of symbolic= links. > =20 > 3) Yet weaker system calls: lstat and readlink. It is not obvious wh= ether > these system calls should produce any (essential) file-level dependen= cies, > so I leave them out, at least for now. Please let me know if they re= ally should. > I mean I need a real-world counterexample. > =20 > 4) link and symlink, which can produce file-level dependencies in very > pathological cases: it is possible to link e.g. `ln /bin/cat $PWD/cat= ' and then > use $PWD/cat. But it is possible to bypass buildreq even easier: > =20 > $ /usr/share/buildreqs/strace_files sh -c 'cd /bin && ./cat /dev/null= ' |grep cat > $ > =20 > So I think that we should not resolve very pathological cases until w= e can resolve > less pathological cases. I leave leave link and symlink out. > =20 > 5) Directory system calls like chdir or mkdir. Since filereq probabl= y should > not output directories, I leave these system calls out. > =20 > 6) Unrelated system calls. > =20 > That said, I am going to consider only the following system calls: > 1) Strong system calls -- open and execve. > 2) Weak system calls -- stat and access. > Note that I actually grep them by prefix to allow stat64 or something. ptrace(2) is expensive tool. If strace TF selector is not optimal for our needs, then we could consider implementing new strace selector, e.g. TB (trace=3Dbuildreq). > Now it is possible that stat and access will produce more unrelated > dependencies than they can add useful dependencies. I added debugging > output to show the list of files that have been accessed only with st= at > or access, but not with open or execve; so that we can analyze whether > stat and access yield something useful at all (and maybe remove them = later). > =20 > Also split output in two portions: the list of files from system calls > and list of files obtained with readlink. Now we can visually discri= minate > between the two (but the list is still unique). Let's try. I added your name to rpm-utils uploaders list. P.S. If we decide to patch strace, this discussion may help me to explain Roland why we need new selector. --=20 ldv --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFF/ZOYfKvmrJ41Nh4RAgVYAJ9vT2pITq59G+hkug3KKnLH8xZChwCZAcxG SPCaXA9fcmjMlWgfCtBfMDA= =PiPh -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--