public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] testsuite: Fix break-interp.exp without prelink installed
@ 2010-03-26 17:48 Jan Kratochvil
  2010-03-26 18:47 ` [patch] testsuite: Fix break-interp.exp without prelink installed #2 Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-03-26 17:48 UTC (permalink / raw)
  To: gdb-patches

Hi,

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)


Tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.


Thanks,
Jan


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

	Cope with missing /usr/sbin/prelink.
	* gdb.base/break-interp.exp (prelinkNO, prelinkYES)
	<result == 1 && $output is "no such file or directory">: New.

--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -134,6 +134,28 @@ proc prelinkNO {arg {name {}}} {
     set run [prelinkNO_run $arg]
     set result [lindex $run 0]
     set output [lindex $run 1]
+    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 command "exec readelf -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 || [regexp {\.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 run [prelinkNO_run $arg]
@@ -160,6 +182,14 @@ proc prelinkYES {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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] testsuite: Fix break-interp.exp without prelink  installed #2
  2010-03-26 17:48 [patch] testsuite: Fix break-interp.exp without prelink installed Jan Kratochvil
@ 2010-03-26 18:47 ` Jan Kratochvil
  2010-03-29 11:04   ` [cancel] " Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-03-26 18:47 UTC (permalink / raw)
  To: gdb-patches

just an IMO-unimportant update - as it is already a native-limited test:
	set readelf_program [transform readelf]


On Fri, 26 Mar 2010 18:48:39 +0100, Jan Kratochvil wrote:
Hi,

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)


Tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.


Thanks,
Jan


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

	Cope with missing /usr/sbin/prelink.
	* gdb.base/break-interp.exp (prelinkNO, prelinkYES)
	<result == 1 && $output is "no such file or directory">: New.

--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -134,6 +134,29 @@ proc prelinkNO {arg {name {}}} {
     set run [prelinkNO_run $arg]
     set result [lindex $run 0]
     set output [lindex $run 1]
+    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 run [prelinkNO_run $arg]
@@ -160,6 +183,14 @@ proc prelinkYES {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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [cancel] Re: [patch] testsuite: Fix break-interp.exp without prelink   installed #2
  2010-03-26 18:47 ` [patch] testsuite: Fix break-interp.exp without prelink installed #2 Jan Kratochvil
@ 2010-03-29 11:04   ` Jan Kratochvil
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2010-03-29 11:04 UTC (permalink / raw)
  To: gdb-patches

Cancelled as it is being reposted rediffed in a larger series.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-29 11:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-26 17:48 [patch] testsuite: Fix break-interp.exp without prelink installed Jan Kratochvil
2010-03-26 18:47 ` [patch] testsuite: Fix break-interp.exp without prelink installed #2 Jan Kratochvil
2010-03-29 11:04   ` [cancel] " Jan Kratochvil

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).