[lldb-dev] [Bug 21946] New: stdin should not be read-only

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 18 03:19:36 PST 2014


            Bug ID: 21946
           Summary: stdin should not be read-only
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: bruce.mitchener at gmail.com
    Classification: Unclassified

In ProcessLaunchInfo, there is this code:

            if (default_to_use_pty && (!in_path || !out_path || !err_path)) {
                if (m_pty->OpenFirstAvailableMaster(O_RDWR| O_NOCTTY, NULL, 0))
                    const char *slave_path = m_pty->GetSlaveName(NULL, 0);

                    if (!in_path) {
                        AppendOpenFileAction(STDIN_FILENO, slave_path, true,

                    if (!out_path) {
                        AppendOpenFileAction(STDOUT_FILENO, slave_path, false,

                    if (!err_path) {
                        AppendOpenFileAction(STDERR_FILENO, slave_path, false,

Where the prototype of AppendOpenFileAction is:

    bool ProcessLaunchInfo::AppendOpenFileAction (int fd, const char *path,
bool read, bool write)

Unfortunately, some programs rely upon being able to write to stdin and work
fine when run normally, but fail when run under lldb.  I'm pretty sure that the
failure is due to this read-only stdin being created ... I've run into this
with libtermkey.

There's nothing in
http://pubs.opengroup.org/onlinepubs/009695399/functions/stdin.html which says
stdin should be read-only (or that it should be writeable) and I'm not sure
what else other documents might say.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141218/34ab3189/attachment.html>

More information about the lldb-dev mailing list