-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PMI non-determinism and a potential deadlock. (#252)
PMI in DRIVEALL mode invokes subprocesses in PREPALL mode in order to be able to recover from errors. We had COMPlus environment variables (including COMPlus_JitStdOutFile) set for both the parent and child processes so the jit emitted disassembly, etc. to the same file. The parent process was still active when the child was running (e.g., it called p.StandardOutput.ReadToEnd()). That resulted in duplicate methods (especially from System.Private.Corelib) in the dasm file and non-deterministic output interleaving. The fix is not to set the COMPlus environment variables in jit-dasm-pmi when invoking pmi but instead pass them in PMIENV environment variable as semicolon-separated name=value pairs and set the actual COMPlus environment variables only on child processes. I also fixed a potential deadlock in output/error redirection: at least one of the redirected steams has to be read asynchronously. See https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardoutput for details.
- Loading branch information
1 parent
0d7710a
commit e209e16
Showing
3 changed files
with
77 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters