[Bug 24976] New: Data from SBProcess::PutSTDIN appears in SBProcess::GetSTDOUT

Bug ID 24976
Summary Data from SBProcess::PutSTDIN appears in SBProcess::GetSTDOUT
Product lldb
Version 3.6
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter berykubik@gmail.com
CC llvm-bugs@lists.llvm.org
Classification Unclassified

Created attachment 14953 [details]
Python script with PutSTDIN and GetSTDOUT test

When I use the function SBProcess::PutSTDIN to put data into process' STDIN,
the entered data then appears when I get the process' STDOUT.

I attached C++ test program which reads a string (x) and then outputs "stdout:
<x>" and a python script that shows that the stdout contains both "stdout: <x>"
and x. The sleep is there to wait for the program to output data.

// C++ program:
#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
    string a;
    cin >> a;
    cout << "stdout: " << a << endl;

    return 0;
}

After I run this program with input "test", it should output "stdout: test".
But when I put "test" to the process via PutSTDIN, the GetSTDOUT contains both
"test" and "stdout: test".

Am I doing something wrong?

labath@google.com changed bug 24976

What | Removed | Added |

  • | - | - |
    Status | NEW | RESOLVED |
    Resolution | — | WONTFIX |

Comment # 3 on bug 24976 from labath@google.com

I'm gonna call this "working as intended".