<html>
    <head>
      <base href="http://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 --- - Setting a breakpoint on Windows leads to the target image file not being deletable for a short time even AFTER the process exits."
   href="http://llvm.org/bugs/show_bug.cgi?id=21723">21723</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Setting a breakpoint on Windows leads to the target image file not being deletable for a short time even AFTER the process exits.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>zturner@google.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zturner@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The python test suite uses LLDB as an in-process extension module.  When
running a test, it test suite first compiles the test program from source, and
then debugs the resulting executable.  When the test invokes LLDB's public API
to set a breakpoint, this is implemented by an eventual call to
WriteProcessMemory to write a breakpoint opcode into the target.  After the
test is complete, the test runner attempts to delete the compiled executable.

For some reason, this call to WriteProcessMemory prevents the test runner from
deleting the executable (error value is ERROR_ACCESS_DENIED).  Commenting out
this one system call -- and nothing else -- results in the executable being
deletable by the test suite.

This is incredibly strange behavior, and although I suspect a race condition
between closing all the handles to the process and the test runner attempting
to delete the process (perhaps a side effect of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Process Plugins do not get shutdown cleanly from the test runner"
   href="show_bug.cgi?id=21722">Bug 21722</a>), there's no
reasonable explanation why WriteProcessMemory would trigger the race.  

The fix may be as simple as fixing <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Process Plugins do not get shutdown cleanly from the test runner"
   href="show_bug.cgi?id=21722">Bug 21722</a>, but it also may be something
different.  And even if it is, it might be worth investigating this further and
filing a bug against the Windows kernel.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>