bugDejaGnu - Bugs: bug #11834, local_exec returns no output if...


bug #11834: local_exec returns no output if using inp/outp

Submitted by:  None
Submitted on:  Thu Feb 3 07:26:56 2005  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Ben Elliston <bje>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sat Aug 31 01:00:29 2013, comment #3:

No feedback after two years.

Ben Elliston <bje>
Project AdministratorIn charge of this item.
Fri Mar 11 10:38:25 2011, comment #2:

Sorry, I trimmed my last comment a bit too much. For completeness, this is the output I get:

NOTE: status :0 {10}:
NOTE: comp_output :10:

Ben Elliston <bje>
Project AdministratorIn charge of this item.
Fri Mar 11 10:33:18 2011, comment #1:

I wrote the following test case based on your report:

set status [local_exec "wc -l" "/etc/hosts" "" 3]
note "status :$status:"
set comp_output [lindex $status 1]
note "comp_output :$comp_output:"

which produces:

Running foo.exp ...
NOTE: status :0 {10}:

So, it appears fixed in version 1.5. Can you please confirm?

Ben Elliston <bje>
Project AdministratorIn charge of this item.
Thu Feb 3 07:26:56 2005, original submission:

I have a test function being called using the dg.exp harness that looks like this:

proc filtergen-dg-test { filter do_what extra } {
set status [local_exec "input/filtergen/t/scan" "$filter" "" 3]

verbose "status :$status:"
set comp_output [lindex $status 1]
verbose "comp_output :$comp_output:"
return [list $comp_output]

the last lines of local_exec (file remote.exp) look like:

verbose "output is $output"
if { $outp == "" } {
return [list $status $output]
} else {
return [list $status ""]

When runtest -v -v -v -v is run, I can see that $output is set correctly, but $status and $comp_output never are.

Further investigation shows that this is because $outp is being set:

if ($inp == "" && $outp = "") {
} else {
if ($outp == "") {
set outp "|& cat"

which means that outp will end up never remaining empty if inp is set. The net result is that if you call local_exec and specify a file to stream into stdin, you can't get any output.

I hacked around this locally by removing the if block, returning [list $status $output] regardless, though instead I think it needs a different variable to use to record the state of $outp.




(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bje (Updated the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Aug 31 01:01:17 2013bjeOpen/ClosedOpen=>Closed
    Sat Aug 31 01:00:00 2013bjeStatusReady For Test=>Works For Me
    Fri Mar 11 11:37:41 2011bjeAssigned toNone=>bje
    Fri Mar 11 11:36:33 2011bjeStatusWorks For Me=>Ready For Test
    Fri Mar 11 10:33:18 2011bjeStatusIn Progress=>Works For Me
    Thu Mar 10 23:04:40 2011bjeStatusNone=>In Progress
    Thu Feb 3 07:35:07 2005jaqCarbon-Copy-=>Added jaq

    Back to the top

    Powered by Savane 3.1-cleanup1