Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1573

PpidChecker inherits and blocks resources from tests while checking if the forked VM is still alive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Feedback Received
    • 2.22.0
    • None
    • None
    • None
    • Windows, our tests create temporary files using native-code (std::fstream) and remove or rename them using boost::filesystem. Java 1.8.

    Description

      On Windows, the PpidChecker executes wmic through cmd by starting a new process. Java calls CreateProcess with the flag bInheritHandles=TRUE.

      When I create a temporary file in a test, it happens that this file can neither be removed nor deleted. The error code is the following (from https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--0-499-)

      ERROR_SHARING_VIOLATION
      
      32 (0x20)
      
      The process cannot access the file because it is being used by another process.

      I found out that this sharing violation is due to the fact that the process started from PpidChecker also owns the file inherited from the test process.

      This seems to be a side-effect of the new monitoring mechanism for the forked VM introduced in 2.20.1 with SUREFIRE-1302.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marcus.ackermann@ptvgroup.com Marcus Ackermann
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: