* Help with solaris testing
@ 2008-07-29 15:38 Pedro Alves
2008-07-29 15:43 ` Mark Kettenis
0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2008-07-29 15:38 UTC (permalink / raw)
To: gdb; +Cc: kettenis, Joel Brobecker
Hi guys!
(Mark, Joel, CCing you, as you're the usual suspects when we
talk about either BSD or (!linux && !windows) testing :-) )
I wonder if you could give me a little help with this.
I've setup a bunch of VMWare VMs (x86) to be able to test changes I'm
making to BSD targets. I've got FreeBSD 6,7, OpenBSD 4.3, and
OpenSolaris 10 all set up. I set up an NFS mount on the host,
so all VMs share the same source tree. All cool, and great
for easy testing. FreeBSD and OpenBSD are OK, but ...
... solaris is giving be the troubles.
When running the testsuite under Solaris, I get a bunch of failures
and they appear to be related to something translating "\r" -> "\r\n".
The eols end up being "\r\r\n" instead of "\r\n", and a lot of test
patterns don't expect that.
How do people test under solaris? Is this perhaps a well known
issue with an easy well known fix?
Same results either sshing to the VM, or testing on a local
terminal inside the VM.
E.g.:
expect: does "break main\r\r\nBreakpoint 1: file ../../../src/gdb/testsuite/gdb.base/call-ar-st.c, line 1195.\r\r\n(gdb) " (spawn_id exp10) match regular expression "Breakpoint
[0-9]* at .*: file .*, line [0-9]+.\r\n\(gdb\) $"? no
"Breakpoint [0-9]*: file .*, line [0-9]+.\r\n\(gdb\)
"Breakpoint [0-9]* at .*\(gdb\) $"? no
"Breakpoint [0-9]* \(.*\) pending.*\(gdb\) $"? no
"Make breakpoint pending.*y or \[n\]. $"? no
"\(gdb\) $"? yes
expect: set expect_out(0,string) "(gdb) "
expect: set expect_out(spawn_id) "exp10"
expect: set expect_out(buffer) "break main\r\r\nBreakpoint 1: file ../../../src/gdb/testsuite/gdb.base/call-ar-st.c, line 1195.\r\r\n(gdb) "
FAIL: gdb.base/call-ar-st.exp: setting breakpoint at main
This is a default setup of OpenSolaris 10, with the only extra
things being gcc, gmake, etc, to be able to build gdb.
I've tried a bunch of stty settings, but perhaps I missed
something. Maybe dejagnu overrides the stty settings anyway,
I don't know.
Running gdb throught od -c shows that gdb is only outputting a single '\n':
0000360 v = 0 x 8 0 4 7 c c 0 ) a t
0000400 . . / . . / s r c / g d b / g d
0000420 b . c : 2 8 \n 2 8 \t m e m s
That was a bit of:
Temporary breakpoint 1, main (argc=1, argv=0x8047cc0) at ../../src/gdb/gdb.c:28
28 memset (&args, 0, sizeof args);
Any hints?
pedro@opensolaris:~$ runtest --version
WARNING: Couldn't find the global config file.
Expect version is 5.42.1
Tcl version is 8.4
Framework version is 1.4.4
pedro@opensolaris:~$ uname -a
SunOS opensolaris 5.11 snv_86 i86pc i386 i86pc Solaris
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help with solaris testing
2008-07-29 15:38 Help with solaris testing Pedro Alves
@ 2008-07-29 15:43 ` Mark Kettenis
2008-08-05 13:49 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2008-07-29 15:43 UTC (permalink / raw)
To: pedro; +Cc: gdb, brobecker
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Tue, 29 Jul 2008 15:58:21 +0100
>
> Hi guys!
>
> (Mark, Joel, CCing you, as you're the usual suspects when we
> talk about either BSD or (!linux && !windows) testing :-) )
>
> I wonder if you could give me a little help with this.
>
> I've setup a bunch of VMWare VMs (x86) to be able to test changes I'm
> making to BSD targets. I've got FreeBSD 6,7, OpenBSD 4.3, and
> OpenSolaris 10 all set up. I set up an NFS mount on the host,
> so all VMs share the same source tree. All cool, and great
> for easy testing. FreeBSD and OpenBSD are OK, but ...
>
> ... solaris is giving be the troubles.
>
> When running the testsuite under Solaris, I get a bunch of failures
> and they appear to be related to something translating "\r" -> "\r\n".
> The eols end up being "\r\r\n" instead of "\r\n", and a lot of test
> patterns don't expect that.
>
> How do people test under solaris? Is this perhaps a well known
> issue with an easy well known fix?
This is strange; I've tested GDB on Solaris in the past and never
encountered this problem.
What does stty -a say on the system? Could it be that one of ocrnl or
onlret is set?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Help with solaris testing
2008-07-29 15:43 ` Mark Kettenis
@ 2008-08-05 13:49 ` Pedro Alves
2008-08-05 14:04 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2008-08-05 13:49 UTC (permalink / raw)
To: gdb; +Cc: Mark Kettenis, brobecker
[-- Attachment #1: Type: text/plain, Size: 1994 bytes --]
Hi Mark, thanks, and sorry for not replying sooner. Only now
I came back to the issue.
On Tuesday 29 July 2008 16:39:15, Mark Kettenis wrote:
> > When running the testsuite under Solaris, I get a bunch of failures
> > and they appear to be related to something translating "\r" -> "\r\n".
> > The eols end up being "\r\r\n" instead of "\r\n", and a lot of test
> > patterns don't expect that.
> >
> > How do people test under solaris? Is this perhaps a well known
> > issue with an easy well known fix?
>
> This is strange; I've tested GDB on Solaris in the past and never
> encountered this problem.
>
> What does stty -a say on the system? Could it be that one of ocrnl or
> onlret is set?
Hmm, not really.
-bash-3.2$ /usr/bin/stty -a
...
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
I just found a workaround. Overriding the stty settings expect does on
the pty used in spawn's,
proc default_gdb_start { } {
...
global stty_init
set stty_init "<the stty -a settings of my terminal>"
...
}
... makes the issue go away.
This bit here http://www.cotse.com/dlf/man/expect/spawn.htm:
"Internally, spawn uses a pty, initialized the same way as the user’s tty.
This is further initialized so that all settings are “sane” (according to
stty(1))."
The latter seems to indicate where the problem is:
On solaris:
pedro@opensolaris:~/orlando/gdb/multi_process/build-solaris/gdb$ /usr/bin/stty
speed 38400 baud; -parity
rows = 34; columns = 118; ypixels = 0; xpixels = 0;
swtch = <undef>;
brkint -inpck -istrip icrnl -ixon ixoff imaxbel onlcr onocr tab3 echo echoe echok echonl echoctl echoke iexten
On linux:
[pedro@orlando][~/gdb/multi_process/src/gdb/testsuite/gdb.base]>/bin/stty
speed 38400 baud; line = 0;
-brkint -imaxbel iutf8
Probably, passing -nottyinit to spawn would "fix" it too.
Anybody seen this before? What's the correct fix for this?
--
Pedro Alves
[-- Attachment #2: fix_expect_sol.diff --]
[-- Type: text/x-diff, Size: 880 bytes --]
---
gdb/testsuite/lib/gdb.exp | 4 ++++
1 file changed, 4 insertions(+)
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp 2008-08-05 14:03:59.000000000 +0100
+++ src/gdb/testsuite/lib/gdb.exp 2008-08-05 14:42:40.000000000 +0100
@@ -1154,6 +1154,10 @@ proc default_gdb_start { } {
global gdb_prompt
global timeout
global gdb_spawn_id;
+ global stty_init
+
+# set stty_init raw
+ set stty_init "-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0 ff0 isig icanon iexten echo echoe echok echonl -noflsh -xcase -tostop -echoprt echoctl echoke"
gdb_stop_suppressing_tests;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Help with solaris testing
2008-08-05 13:49 ` Pedro Alves
@ 2008-08-05 14:04 ` Daniel Jacobowitz
2008-08-05 14:33 ` Mark Kettenis
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2008-08-05 14:04 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, Mark Kettenis, brobecker
On Tue, Aug 05, 2008 at 02:46:00PM +0100, Pedro Alves wrote:
> I just found a workaround. Overriding the stty settings expect does on
> the pty used in spawn's,
>
> proc default_gdb_start { } {
> ...
> global stty_init
> set stty_init "<the stty -a settings of my terminal>"
>
> ...
> }
>
> ... makes the issue go away.
Could you binary search to find the stty option that's a problem? The
default in expect is "stty sane"; the Linux man page for stty defines
what "sane" is equivalent to, but you should check the OpenSolaris man
page to see what it says. Or run stty sane / stty -a in a pty.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Help with solaris testing
2008-08-05 14:04 ` Daniel Jacobowitz
@ 2008-08-05 14:33 ` Mark Kettenis
2008-08-07 22:32 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2008-08-05 14:33 UTC (permalink / raw)
To: drow; +Cc: pedro, gdb, mark.kettenis, brobecker
> Date: Tue, 5 Aug 2008 10:03:16 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> On Tue, Aug 05, 2008 at 02:46:00PM +0100, Pedro Alves wrote:
> > I just found a workaround. Overriding the stty settings expect does on
> > the pty used in spawn's,
> >
> > proc default_gdb_start { } {
> > ...
> > global stty_init
> > set stty_init "<the stty -a settings of my terminal>"
> >
> > ...
> > }
> >
> > ... makes the issue go away.
>
> Could you binary search to find the stty option that's a problem? The
> default in expect is "stty sane"; the Linux man page for stty defines
> what "sane" is equivalent to, but you should check the OpenSolaris man
> page to see what it says. Or run stty sane / stty -a in a pty.
On Solaris 10, I get:
$ stty
speed 38400 baud;
rows = 24; columns = 80; ypixels = 316; xpixels = 484;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = <undef>; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
and "stty sane" changes that to:
speed 38400 baud;
rows = 24; columns = 80; ypixels = 316; xpixels = 484;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = <undef>; werase = ^w; lnext = ^v;
parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
which seems to be sane enough for me. But the OpenSolaris defaults that Pedro showed don't seem sane to me.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Help with solaris testing
2008-08-05 14:33 ` Mark Kettenis
@ 2008-08-07 22:32 ` Pedro Alves
0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2008-08-07 22:32 UTC (permalink / raw)
To: gdb; +Cc: Mark Kettenis, drow, brobecker
On Tuesday 05 August 2008 15:29:34, Mark Kettenis wrote:
> On Solaris 10, I get:
>
>
> $ stty
> speed 38400 baud;
> rows = 24; columns = 80; ypixels = 316; xpixels = 484;
> csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = <undef>; werase = ^w; lnext = ^v;
> -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff
> -parext -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl
> -iuclc ixon -ixany -ixoff -imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
>
On a clean login, I get,
pedro@opensolaris:~/orlando/gdb/multi_process/build-solaris/gdb$ stty -a
speed 38400 baud; rows 30; columns 80;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0
ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
>
> and "stty sane" changes that to:
>
>
> speed 38400 baud;
> rows = 24; columns = 80; ypixels = 316; xpixels = 484;
> csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = <undef>; werase = ^w; lnext = ^v;
> parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff
> -parext -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl
> -iuclc ixon -ixany -ixoff imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
>
And after "stty sane":
pedro@opensolaris:~/orlando/gdb/multi_process/build-solaris/gdb$ /usr/bin/stty
speed 38400 baud; -parity
rows = 30; columns = 80; ypixels = 0; xpixels = 0;
brkint -inpck -istrip icrnl -ixany imaxbel onlcr
echo echoe echok echoctl echoke iexten
pedro@opensolaris:~/orlando/gdb/multi_process/build-solaris/gdb$ /usr/bin/stty -a
speed 38400 baud;
rows = 30; columns = 80; ypixels = 0; xpixels = 0;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = ^z;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl
cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
> which seems to be sane enough for me. But the OpenSolaris defaults that
> Pedro showed don't seem sane to me.
Sorry, I may have mixed up what I showed, because I only learned after
the fact that "stty" != "stty sane". :-)
Here's a diff of what you see after stty sane, and what I see after stty sane.
The ">" version is yours:
$ /usr/bin/stty -a
> speed 38400 baud;
speed 38400 baud;
> rows = 24; columns = 80; ypixels = 316; xpixels = 484;
rows = 30; columns = 80; ypixels = 0; xpixels = 0;
> csdata ?
csdata ?
> eucw 1:0:0:0, scrw 1:0:0:0
eucw 1:0:0:0, scrw 1:0:0:0
> intr = ^c; quit = ^\; erase = ^?; kill = ^u;
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
> eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = ^z;
> start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
> rprnt = ^r; flush = <undef>; werase = ^w; lnext = ^v;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
^^^
> parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff
^^^
> -parext -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl
-parext -ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl
^^^^
> -iuclc ixon -ixany -ixoff imaxbel
-iuclc ixon -ixany -ixoff imaxbel
> isig icanon -xcase echo echoe echok -echonl -noflsh
isig icanon -xcase echo echoe echok -echonl -noflsh
> -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
> opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
I then went through the all the options I had used in the workaround,
and identified that it is setting onocr that makes the "\r\r\n" go away.
I'm now working around this by replacing /usr/bin/stty by:
#!/bin/sh
if [ $# == 1 ] && [ x"$1" == xsane ]
then
exec /usr/bin/stty.org $* onocr
else
exec /usr/bin/stty.org $*
fi
The gdb.mi tests all fail because all commands that GDB sends
are echoed back :-(. If I remove the onocr, the GDB commands are
not output at all. :-(
MI testing is not important for me, though, so I consider
it a victory that I'm able to test at all...
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-08-07 22:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-29 15:38 Help with solaris testing Pedro Alves
2008-07-29 15:43 ` Mark Kettenis
2008-08-05 13:49 ` Pedro Alves
2008-08-05 14:04 ` Daniel Jacobowitz
2008-08-05 14:33 ` Mark Kettenis
2008-08-07 22:32 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox