Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796
@ 2012-03-03  7:01 Jan Kratochvil
  2012-03-03 14:30 ` Yao Qi
  2012-03-03 15:17 ` Pedro Alves
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kratochvil @ 2012-03-03  7:01 UTC (permalink / raw)
  To: gdb-patches

Hi,

[patch] Fix disp-step-syscall.exp on some i386 targets
http://sourceware.org/ml/gdb-patches/2012-02/msg00635.html

just fixed a testcase which revealed existing IMO gdbserver Bug, therefore
just KFAILed it.

stepi
Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork
Child terminated with signal = 0x4 (SIGILL)
GDBserver exiting
print /x $pc
No registers.
(gdb) FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)

->
http://sourceware.org/bugzilla/show_bug.cgi?id=13796


Regards,
Jan


http://sourceware.org/ml/gdb-cvs/2012-03/msg00073.html

--- src/gdb/testsuite/ChangeLog	2012/03/02 20:36:39	1.3115
+++ src/gdb/testsuite/ChangeLog	2012/03/03 06:58:16	1.3116
@@ -1,3 +1,8 @@
+2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Setup KFAIL for PR server/13796.
+	* gdb.base/disp-step-syscall.exp (single step over vfork): Setup KFAIL.
+
 2012-03-02  Joel Brobecker  <brobecker@adacore.com>
 
 	* gdb.ada/operator_bp: New testcase.
--- src/gdb/testsuite/gdb.base/disp-step-syscall.exp	2012/02/29 14:59:41	1.6
+++ src/gdb/testsuite/gdb.base/disp-step-syscall.exp	2012/03/03 06:58:16	1.7
@@ -118,7 +118,20 @@
     gdb_test_no_output "set displaced-stepping on"
 
     # Check the address of next instruction of syscall.
-    gdb_test "stepi" ".*" "single step over $syscall"
+    if {$syscall == "vfork" && [is_remote target]} {
+	setup_kfail server/13796 "*-*-*"
+    }
+    set test "single step over $syscall"
+    gdb_test_multiple "stepi" $test {
+	-re "Program terminated with signal SIGILL,.*\r\n$gdb_prompt $" {
+	    fail $test
+	    return
+	}
+	-re "\r\n$gdb_prompt $" {
+	    pass $test
+	}
+    }
+
     set syscall_insn_next_addr_found [get_hexadecimal_valueof "\$pc" "0"]
 
     set test "single step over $syscall final pc"


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

* Re: [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796
  2012-03-03  7:01 [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796 Jan Kratochvil
@ 2012-03-03 14:30 ` Yao Qi
  2012-03-03 14:34   ` Jan Kratochvil
  2012-03-03 15:17 ` Pedro Alves
  1 sibling, 1 reply; 4+ messages in thread
From: Yao Qi @ 2012-03-03 14:30 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 03/03/2012 03:01 PM, Jan Kratochvil wrote:
> -    gdb_test "stepi" ".*" "single step over $syscall"
> +    if {$syscall == "vfork" && [is_remote target]} {
> +	setup_kfail server/13796 "*-*-*"
> +    }
> +    set test "single step over $syscall"
> +    gdb_test_multiple "stepi" $test {
> +	-re "Program terminated with signal SIGILL,.*\r\n$gdb_prompt $" {
> +	    fail $test
> +	    return
> +	}
> +	-re "\r\n$gdb_prompt $" {
> +	    pass $test
> +	}
> +    }
> +

Yes, it looks like a bug in GDBserver.  The test case doesn't catch
the output below in my env, and get a KPASS.

(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
stepi
[Inferior 1 (process 46507) exited normally]^M

Child exited with status 0
GDBserver exiting^M
(gdb) KPASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS server/13796)

Patch below is to fix this, OK to apply?

-- 
Yao (齐尧) 

gdb/testsuite/
	* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Catch error
	messages for KFAIL.

diff --git a/gdb/testsuite/gdb.base/disp-step-syscall.exp b/gdb/testsuite/gdb.base/disp-step-syscall.exp
index 486701c..915cb97 100644
--- a/gdb/testsuite/gdb.base/disp-step-syscall.exp
+++ b/gdb/testsuite/gdb.base/disp-step-syscall.exp
@@ -127,6 +127,10 @@ proc disp_step_cross_syscall { syscall } { with_test_prefix "$syscall" {
            fail $test
            return
        }
+       -re "\\\[Inferior .* exited normally\\\].*\r\n$gdb_prompt $" {
+           fail $test
+           return
+       }
        -re "\r\n$gdb_prompt $" {
            pass $test
        }


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

* Re: [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796
  2012-03-03 14:30 ` Yao Qi
@ 2012-03-03 14:34   ` Jan Kratochvil
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2012-03-03 14:34 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On Sat, 03 Mar 2012 15:30:28 +0100, Yao Qi wrote:
> (gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
> stepi
> [Inferior 1 (process 46507) exited normally]^M
> 
> Child exited with status 0
> GDBserver exiting^M
> (gdb) KPASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS server/13796)
> 
> Patch below is to fix this, OK to apply?

I did not analyze gdbserver so I do not know now what happens there, it may be
also Linux kernel-version specific.

I find your patch OK for the testsuite, check it in, please.


Thanks,
Jan


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

* Re: [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796
  2012-03-03  7:01 [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796 Jan Kratochvil
  2012-03-03 14:30 ` Yao Qi
@ 2012-03-03 15:17 ` Pedro Alves
  1 sibling, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2012-03-03 15:17 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

On 03/03/2012 07:01 AM, Jan Kratochvil wrote:
> Hi,
> 
> [patch] Fix disp-step-syscall.exp on some i386 targets
> http://sourceware.org/ml/gdb-patches/2012-02/msg00635.html
> 
> just fixed a testcase which revealed existing IMO gdbserver Bug, therefore
> just KFAILed it.
> 
> stepi
> Program terminated with signal SIGILL, Illegal instruction.
> The program no longer exists.
> (gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork
> Child terminated with signal = 0x4 (SIGILL)
> GDBserver exiting
> print /x $pc
> No registers.
> (gdb) FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)

I've analized this one before.  The issue is that the test displace-steps over a vfork syscall.
In the special case of displace-stepping over a fork, GDB needs to adjust both the parent and
the child back from the displace stepping scratchpad.   Since GDBserver doesn't
support following (v)forks yet, gdb is never informed about the child, and so the child
ends up continuing freely, unadjusted, from the scratchpad, and crashes.

So this is all really about the remote protocol not supporting following forks yet.

-- 
Pedro Alves


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

end of thread, other threads:[~2012-03-03 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03  7:01 [obv] testsuite: disp-step-syscall.exp: Setup KFAIL for PR server/13796 Jan Kratochvil
2012-03-03 14:30 ` Yao Qi
2012-03-03 14:34   ` Jan Kratochvil
2012-03-03 15:17 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox