On Fri, 2014-10-10 at 08:03 -0400, David Malcolm wrote:
> [replying on the mailing list, with Ben's permission to quote his
> initial off-list msg]
> 
> On Fri, 2014-10-10 at 10:34 +1100, Ben Elliston wrote:
> > Hi David,
> > 
> > You're right that it looks like it should be full_buffer, not
> > buffer_full.  What happens if you fix that?
> 
> Hacking in a "-d" into runtest's invocation of expect, I see this in the
> log (the 1st time through):
> 
>   expect: does "" (spawn_id exp0) match glob pattern "buffer_full"? no
> 
> i.e. it does indeed treat "buffer_full" as a glob pattern, rather than a
> keyword.
> 
> Fixing the spelling to "full_buffer" doesn't fix the issue (log with -d
> attached)
> 
> However, moving the "expect_before" line to *after* the "spawn"
> invocation does: is the "expect_before" line too early?
> 
> My current belief here is that it's picking up the wrong spawn:
> "spawn_id exp0" doesn't seem to be the right thing for it to be
> listening on (am I right in thinking that's the "default" stdin/stout,
> rather than the not-yet-spawned program?)
> 
> Have been attempting to come up with a more minimal reproducer, but
> failing so far - some kind of heisenbug timing needed to expose this
> issue, perhaps?  Though I reliably hit it with my current setup, with:
>   make check-gcc check-jit -j2
> 
> [my copy of "Exploring Expect" is due for delivery at some point today,
> so may have more conceptual grounding in this in a day
> or so].

I haven't been able to come up with a more minimal reproducer, but for
reference, here's the patch I'm applying locally that fixes the problem.

        * lib/dejagnu.exp (host_execute): Move the expect_before to
        directly after the "spawn", and use "full_buffer", which is an
        expect keyword rather than "buffer_full", which isn't.

--- /usr/share/dejagnu/dejagnu.exp.old	2014-10-08 13:38:57.274068541 -0400
+++ /usr/share/dejagnu/dejagnu.exp	2014-10-10 12:27:51.113813659 -0400
@@ -113,8 +113,6 @@ proc host_execute {args} {
     set timetol 0
     set arguments ""
 
-    expect_before buffer_full { perror "Buffer full" }
-
     if { [llength $args] == 0} {
 	set executable $args
     } else {
@@ -133,6 +131,8 @@ proc host_execute {args} {
     # test case.
     # spawn -noecho -open [open "|./${executable}" "r"]
     spawn -noecho "./${executable}" ${params}
+    expect_before full_buffer { perror "Buffer full" }
+
     set prefix "\[^\r\n\]*"
     expect {
 	-re "^$prefix\[0-9\]\[0-9\]:..:..:${text}*\r\n" {
_______________________________________________
DejaGnu mailing list
DejaGnu@gnu.org
https://lists.gnu.org/mailman/listinfo/dejagnu

Reply via email to