GNU bug report logs -
#49078
dejagnu-1.6.3 test failure
Previous Next
To reply to this bug, email your comments to 49078 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Thu, 17 Jun 2021 19:44:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Xi Ruoyao <xry111 <at> mengyan1223.wang>
:
New bug report received and forwarded. Copy sent to
bug-dejagnu <at> gnu.org
.
(Thu, 17 Jun 2021 19:44:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
ERROR: -------------------------------------------
ERROR: in testcase ./testsuite/runtest.libs/libs.exp
ERROR: send: spawn id exp6 not open
ERROR: tcl error code NONE
ERROR: tcl error info:
send: spawn id exp6 not open
while executing
"exp_send "interp delete test_case""
invoked from within
"if [file exists $test] {
verbose "Processing test $test" 2
exp_send "interp create test_case\n"
expect "interp create test_case*test_case*expect*>..."
(procedure "process_test" line 9)
invoked from within
"process_test $i "
("foreach" body line 2)
invoked from within
"foreach i [lsort -dictionary [glob [testsuite file -source -test
*.test]]] {
if { [runtest_file_p $runtests $i] } { process_test $i }
}"
(file "./testsuite/runtest.libs/libs.exp" line 100)
invoked from within
"source ./testsuite/runtest.libs/libs.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source ./testsuite/runtest.libs/libs.exp"
invoked from within
"catch "uplevel #0 source $test_file_name" msg"
--------------------------------------------------
I know almost nothing about tcl/expect so I have no idea why did this
happen.
--
Xi Ruoyao <xry111 <at> mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Thu, 17 Jun 2021 21:03:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 49078 <at> debbugs.gnu.org (full text, mbox):
Xi Ruoyao wrote:
> send: spawn id exp6 not open
> while executing
> "exp_send "interp delete test_case""
> invoked from within
> "if [file exists $test] {
> [...]
> expect "interp create test_case*test_case*expect*>..."
> (procedure "process_test" line 9)
> invoked from within
> [...]
>
> I know almost nothing about tcl/expect so I have no idea why did this
> happen.
>
The child Expect process is exiting unexpectedly while running test
cases. When the parent later attempts to issue a command ({exp_send
"interp delete test_case"} means type "interp delete test_case" at the
child Expect's prompt), Expect notices that the channel has been closed
and throws a Tcl error ("spawn id EXPN not open"). The new Tcl error
handling in DejaGnu 1.6.3 catches and records this error, then repeats
it after the test run to ensure that you notice that something went very
wrong.
This is suspiciously similar to a previous bug report that I have been
unable to replicate. Please attach the "runtest.log" file to a reply,
as it will have more details that might help me to understand this issue.
-- Jacob
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Fri, 18 Jun 2021 03:51:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 49078 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Thu, 2021-06-17 at 16:02 -0500, Jacob Bachmeyer wrote:
> Xi Ruoyao wrote:
> > send: spawn id exp6 not open
> > while executing
> > "exp_send "interp delete test_case""
> > invoked from within
> > "if [file exists $test] {
> > [...]
> > expect "interp create test_case*test_case*expect*>..."
> > (procedure "process_test" line 9)
> > invoked from within
> > [...]
> >
> > I know almost nothing about tcl/expect so I have no idea why did
> > this
> > happen.
> >
>
> The child Expect process is exiting unexpectedly while running test
> cases. When the parent later attempts to issue a command ({exp_send
> "interp delete test_case"} means type "interp delete test_case" at the
> child Expect's prompt), Expect notices that the channel has been
> closed
> and throws a Tcl error ("spawn id EXPN not open"). The new Tcl error
> handling in DejaGnu 1.6.3 catches and records this error, then repeats
> it after the test run to ensure that you notice that something went
> very
> wrong.
>
> This is suspiciously similar to a previous bug report that I have been
> unable to replicate. Please attach the "runtest.log" file to a reply,
> as it will have more details that might help me to understand this
> issue.
>
>
> -- Jacob
Hi Jacob,
The log is attached.
--
Xi Ruoyao <xry111 <at> mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University
[runtest.log (text/x-log, attachment)]
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Sat, 19 Jun 2021 03:54:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 49078 <at> debbugs.gnu.org (full text, mbox):
The log appears to show a different but related issue compared with
PR47795. Both of you reported logs with the same error occurring at the
same point. In both cases, the child Expect exits for no apparent
reason when directed to execute a unit test file.
I *have* been able to replicate the issue, now that I see a key detail
from the log files: both of you are building in the source directory,
which should work but is not typically tested. Even more bizarrely, the
issue only appears, even in this configuration, on some machines.
Efforts to trace this in the (Expect) code are in progress. What
distributions are each of you running?
Does the problem disappear if you build and test in a separate directory?
-- Jacob
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Sat, 19 Jun 2021 04:17:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 49078 <at> debbugs.gnu.org (full text, mbox):
On Fri, 2021-06-18 at 22:53 -0500, Jacob Bachmeyer wrote:
> The log appears to show a different but related issue compared with
> PR47795. Both of you reported logs with the same error occurring at
> the
> same point. In both cases, the child Expect exits for no apparent
> reason when directed to execute a unit test file.
>
> I *have* been able to replicate the issue, now that I see a key detail
> from the log files: both of you are building in the source directory,
> which should work but is not typically tested. Even more bizarrely,
> the
> issue only appears, even in this configuration, on some machines.
>
> Efforts to trace this in the (Expect) code are in progress. What
> distributions are each of you running?
Linux From Scratch (https://www.linuxfromscratch.org/).
> Does the problem disappear if you build and test in a separate
> directory?
Yes it desappeared. If building in the source directory is not
supported, we can update the LFS book
(https://www.linuxfromscratch.org/lfs/view/development/chapter08/dejagnu.html
).
--
Xi Ruoyao <xry111 <at> mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Sat, 19 Jun 2021 05:59:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 49078 <at> debbugs.gnu.org (full text, mbox):
> Efforts to trace this in the (Expect) code are in progress. What
> distributions are each of you running?
linuxfromscratch
> Does the problem disappear if you build and test in a separate directory?
I confirm that building in a separate directory makes the problem go away
I can add, if it can help, that I've been building in-tree since quite
a lot without ever seeing this problem
thanks a lot for spending time to look into this
ciao
-g
Information forwarded
to
bug-dejagnu <at> gnu.org
:
bug#49078
; Package
dejagnu
.
(Sun, 20 Jun 2021 04:46:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 49078 <at> debbugs.gnu.org (full text, mbox):
Xi Ruoyao wrote:
> If building in the source directory is not
> supported, we can update the LFS book
> (https://www.linuxfromscratch.org/lfs/view/development/chapter08/dejagnu.html
> ).
>
The GNU Coding Standards (7.2.1 "General Conventions for Makefiles"
<URL:https://www.gnu.org/prep/standards/standards.html#Makefile-Basics>)
emphasize that GNU packages should support building outside of the
source directory, and this is generally a recommended practice.
Building in the source directory is usually supported, but less often
tested.
However, DejaGnu is unusual in that the "build procedure" only emits a
message that DejaGnu is ready to install. This works because DejaGnu is
written in a portable interpreted language (Tcl with Expect) and can, in
fact, be used from an unpacked source tree or Git checkout without
installing it at all. This latter option is new-ish and a modern
equivalent for the very deprecated Cygnus tree layout used in the past.
Building in the source tree is supported in DejaGnu, but is less
convenient for testing and therefore less extensively tested during
development. Not that that is relevant here with this bug -- the tests
pass in a source tree on my primary workstation.
These failures are due to a bug in Expect 5.45.4, confirmed to be an
upstream issue because I was able to replicate this on a Fedora box to
which I have access, that causes Expect to incorrectly treat certain
input at an interactive prompt as if it were end-of-file. I am still
looking into the root causes. Building in a separate directory is a
workaround for the underlying Expect bug, since the command that is
tickling the bug will be issued differently (specifically a different
length) and thus not tickle the bug.
I am now looking into how to go about reporting this bug upstream, so
far I have found a "maze of twisty little passages, all alike" and am
not yet certain where to actually send the report when I finish it.
-- Jacob
Owner recorded as jcb62281 <at> gmail.com.
Request was from
Jacob Bachmeyer <jcb62281 <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 11 Aug 2021 01:42:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-dejagnu <at> gnu.org, jcb62281 <at> gmail.com
:
bug#49078
; Package
dejagnu
.
(Sat, 23 Oct 2021 00:11:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 49078 <at> debbugs.gnu.org (full text, mbox):
(I've just sent this to the mailing list, but so it's in the bug report
as well...)
Jacob Bachmeyer <jcb62281 <at> gmail.com> writes:
> Expect is incorrectly treating a line exactly 64 bytes long as EOF.
I've just run into this as well when packaging 1.6.3 -- for me, it
happens on Linux 5.10 but not on Linux 4.19, where expect's read(0, buf,
4096) call reads 65 bytes including the newline. So I guess it's become
visible as a result of some change in Linux tty behaviour...
After a bit of debugging, the cause seems to be that expect uses
Tcl_GetsObj to read from stdin, and treats a -1 return value as an
error. However, Tcl_GetsObj can also return -1 to indicate that input
was blocked, i.e. it didn't manage to read a complete line -- expect
didn't handle this case.
This patch seems to fix the problem:
--- expect5.45.4/exp_main_sub.c 2018-02-04 10:43:58.000000000 +0000
+++ expect5.45.4/exp_main_sub.c 2021-10-23 00:39:09.375404444 +0100
@@ -326,7 +326,9 @@
if (code != EXP_EOF) {
inChannel = expStdinoutGet()->channel;
- code = Tcl_GetsObj(inChannel, commandPtr);
+ do {
+ code = Tcl_GetsObj(inChannel, commandPtr);
+ } while (code < 0 && Tcl_InputBlocked(inChannel));
#ifdef SIMPLE_EVENT
if (code == -1 && errno == EINTR) {
if (Tcl_AsyncReady()) {
(expect experts may have a better solution, of course!)
Thanks,
--
Adam Sampson <ats <at> offog.org> <http://offog.org/>
This bug report was last modified 3 years and 238 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.