-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subprocesses cannot open input files created by bugpoint #37738
Comments
Are you still having problem? I'd check myself, but don't have windows. |
Positive; just tested with r341740 |
Okay, I think this commit is the actual culprit: commit b96a87a
The problem is that if(BitcodeFile.empty()), a TempFile will be created in a local scope, then get deleted before it's used out of scope further down. |
btw, you can test this by using "-save-temps" and see if that solves the problem. |
I don't think that r318459 is the problem. Before submitting this bug, I bisected it to r341740 (meaning it worked before that commit) However Rafael's createUniqueFile refacturing indeed caused problems with bugpoint on Windows, but it has been fixed. See: https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20171120/504298.html With -save-temps: $ bugpoint polly-timeout-grtestutils.ll -save-temps -verify -opt-command=C:\Users\meinersbur\build\llvm\release\bin\opt.exe -opt-args -polly-process-unprofitable *** Debugging optimizer crash! *** Found crashing pass: -verify *** You can reproduce the problem with: opt bugpoint-passes.bc -verify |
Okay, that's a different bug, and I submitted a separate patch for it: |
According to Microsoft docs, https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfileinformationbyhandle "... if the application is using FILE_DISPOSITION_INFO with the DeleteFile member set to TRUE, the file would need DELETE access requested in the call to the CreateFile function." LLVM wraps these windows specific calls in lib/Support/Windows/Path.inc, but only passes DELETE in calls to remove or rename files. However, since TempFile sets FILE_DESPSITION_INFO.DeleteFile = true, subsequent CreateFile calls need to include DELETE access. I don't have windows, so I can't test this, but here's a small patch that unilaterally adds DELETE to the underlying CreateFile calls that you can use to test if this is the actual problem. diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc HANDLE H =
|
This patch unfortunately did not fix the problem. |
*** Bug llvm/llvm-bugzilla-archive#38467 has been marked as a duplicate of this bug. *** |
mentioned in issue llvm/llvm-bugzilla-archive#38467 |
…te issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
I can confirm this issue still happens and makes multiple bugpoint tests fail on windows. My attempt at fixing was to add a optional mode TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition fsfod@0c2f940 |
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
…ile::create issue reported in llvm#37738 Add a new OpenFlags to tell TempFile::create to use FILE_FLAG_DELETE_ON_CLOSE instead of setDeleteDisposition that doesn't allow the file to be opened cross process.
Extended Description
Commit r334630 ("LTO: Keep file handles open for memory mapped files.") broke bugpoint on Windows. The launched opt process cannot access the input file created by bugpoint:
$ (cd 'C:\Users\MEINER
1\AppData\Local\Temp\reproduce-bruxta1h' &&1\AppData\Local\Temp\reproduce-bruxta1h\pr3821817-precompute.ll''C:\Users\meinersbur\build\llvm\release\bin\bugpoint.exe'
'-opt-command=C:\Users\meinersbur\build\llvm\release\bin\opt.exe'
'C:\Users\MEINER
-scoped-noalias -polly-codegen)
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-b43aded.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-6517e54.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-6575634.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-7dad9ae.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-81165ee.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-018d544.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-e88e95a.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-d37f5e8.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-29843f5.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-26d3c62.bc: error: Could not open input file:
permission denied
C:\Users\meinersbur\build\llvm\release\bin\opt.exe:
bugpoint-input-dc3b1bc.bc: error: Could not open input file:
permission denied
verify failed!
bugpoint-input-b43aded.bc is a strange file. I can see it in explorer,
but when trying to open it, Notepad claims it doesn't exist and offers
to create it (which will then fail).
Also see https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180723/573040.html
The text was updated successfully, but these errors were encountered: