public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch 5/6] testsuite: Fix prelink-support.exp without prelink  installed
Date: Mon, 29 Mar 2010 16:18:00 -0000	[thread overview]
Message-ID: <20100329161831.GD2940@host0.dyn.jankratochvil.net> (raw)

Hi,

originally posted as:
	Re: [patch] testsuite: Fix break-interp.exp without prelink installed #2
	http://sourceware.org/ml/gdb-patches/2010-03/msg00912.html

Rediffed only (+that new one return).

------------------------------------------------------------------------------

Found now in a virtual machine that if you have no /usr/sbin/prelink testsuite
produces:

FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugNO: unprelink break-interp-LDprelinkNOdebugNO
...
# of expected passes		10
# of unexpected failures	6


Fixed it, it runs at least the parts it can + XFAILs the others.


/usr/sbin/prelink installed:
# of expected passes            1580

/usr/sbin/prelink not installed, no system libraries prelinked:
# of expected passes            579
# of expected failures          12
XFAIL: gdb.base/break-interp.exp: LDprelinkNOdebugNO: BINprelinkYESdebugNOpieYES: prelink break-interp-BINprelinkYESdebugNOpieYES (missing /usr/sbin/prelink)

/usr/sbin/prelink not installed but some system libraries prelinked - this
should not normally happen:
# of expected passes            12
# of unexpected failures        5
# of expected failures          1
FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugNO: unprelink break-interp-LDprelinkNOdebugNO (missing /usr/sbin/prelink) (/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.base/break-interp-LDprelinkNOdebugNO is already prelinked)


No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
patch series together.


Thanks,
Jan


gdb/testsuite/
2010-03-29  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Cope with missing /usr/sbin/prelink.
	* lib/prelink-support.exp (prelink_no):
	<result == 1 && $output is "no such file or directory">: New.
	(prelink_yes): Likewise.  Return on failed prelink_no.

--- a/gdb/testsuite/lib/prelink-support.exp
+++ b/gdb/testsuite/lib/prelink-support.exp
@@ -168,6 +168,29 @@ proc prelink_no {arg {name {}}} {
     set result [catch $command output]
     verbose -log "result is $result"
     verbose -log "output is $output"
+    if {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {
+	# Without prelink at lest verify all the binaries do not contain the
+	# ".gnu.prelink_undo" section so that they are not already prelinked.
+	set test "$test (missing /usr/sbin/prelink)"
+	foreach bin [split $arg] {
+	    if [string match "-*" $bin] {
+		# Skip prelink options.
+		continue
+	    }
+	    set readelf_program [transform readelf]
+	    set command "exec $readelf_program -WS $bin"
+	    verbose -log "command is $command"
+	    set result [catch $command output]
+	    verbose -log "result is $result"
+	    verbose -log "output is $output"
+	    if {$result != 0 || [string match {* .gnu.prelink_undo *} $output]} {
+		fail "$test ($bin is already prelinked)"
+		return 0
+	    }
+	}
+	pass $test
+	return 1
+    }
     if {$result == 0 && $output == ""} {
 	verbose -log "$name has been now unprelinked"
 	set command "exec /usr/sbin/prelink -uN $arg"
@@ -198,7 +221,9 @@ proc prelink_yes {arg {name ""}} {
     # Try to unprelink it first so that if it has been already prelinked before
     # we get different address now and the result is not affected by the
     # previous $arg state..
-    prelink_no $arg "$name pre-unprelink"
+    if ![prelink_no $arg "$name pre-unprelink"] {
+	return 0
+    }
 
     set test "prelink $name"
 
@@ -216,6 +241,14 @@ proc prelink_yes {arg {name ""}} {
     set result [catch $command output]
     verbose -log "result is $result"
     verbose -log "output is $output"
+    if {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {
+	set test "$test (missing /usr/sbin/prelink)"
+	# While we could check if $arg is already prelinked (as if someone
+	# uninstalls prelink after having the system ld.so prelinked) we cannot
+	# change its prelinked address.  Therefore rather skip the test.
+	xfail $test
+	return 0
+    }
     if {$result == 0 && $output == ""} {
 	pass $test
 	return 1

             reply	other threads:[~2010-03-29 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-29 16:18 Jan Kratochvil [this message]
2010-06-09 15:10 ` ping: " Jan Kratochvil
2010-06-29 22:09   ` Joel Brobecker
2010-07-04 10:19     ` Jan Kratochvil
2010-07-05 17:40       ` Joel Brobecker
2010-07-05 18:13         ` Jan Kratochvil
2010-07-19 15:06       ` Pedro Alves
2010-07-19 15:43         ` Daniel Jacobowitz
2010-07-28 14:26           ` Disable i18n when running the testsuite (Re: ping: [patch 5/6] testsuite: Fix prelink-support.exp without prelink installed) Pedro Alves
2010-07-28 17:36             ` Joel Brobecker
2010-07-29 14:20               ` Disable i18n when running the testsuite Pedro Alves

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=20100329161831.GD2940@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).