<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [Windows] LLDB crashes when launched with a startup script on the command line."
   href="https://llvm.org/bugs/show_bug.cgi?id=31699">31699</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Windows] LLDB crashes when launched with a startup script on the command line.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows XP
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vadimcn@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>- Install LLVM for Windows snapshot build from <a href="http://llvm.org/build">http://llvm.org/build</a> (SVN
r291454, built on 9 January 2017 at the time of filing this).
- Launch LLDB: lldb -O "p 42".
- LLDB crashes.

I've tracked the cause down to snapshot builds being built with a statically
linked CRT (-DLLVM_USE_CRT_RELEASE=MT).  When a startup script is given on the
command line, lldb.exe creates a pipe, writes the script into the write end,
wraps a stdio file around the read end, and gives the resulting FILE* to
SBDebugger::SetInputFileHandle().  Unfortunately, since SBDebugger lives in
liblldb.dll, with its own copy of the CRT, that handle is not valid there. 
Later, it tries to read from that handle, and... boom.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>