Skip to content
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

SignCheck fails with IOException attempting to write to the error log #1300

Closed
natemcmaster opened this issue Nov 8, 2018 · 7 comments
Closed

Comments

@natemcmaster
Copy link
Contributor

I'm attempting to setup SignCheck on https://github.com/aspnet/Extensions, but Microsoft.DotNet.SignCheck.exe always fails while attempting to write an error log file.

Repro
Arguments:

.\Microsoft.DotNet.SignCheck.exe --verbosity Detailed --error-log-file C:\src\aspnet\Extensions\artifacts\logs\signcheck-errors.log --generate-exclusions-file C:\src\aspnet\Extensions\artifacts\logs\signcheck.exclusions.g.txt --input-files C:\src\aspnet\Extensions\artifacts\ --recursive --verify-jar --verify-strongname 

Result
Verification partially completes, but then fails with a fatal error:

image

Ironically, I believe it is SignCheck.exe that has created the file, because this file is created and contains this:

System.IO.IOException: The process cannot access the file 'C:\src\aspnet\Extensions\artifacts\logs\signcheck-errors.log' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.SignCheck.Verification.SignatureVerificationManager.GetFileVerifierByHeader(String path)
   at Microsoft.SignCheck.Verification.SignatureVerificationManager.GetFileVerifier(String path)
   at Microsoft.SignCheck.Verification.SignatureVerificationManager.VerifyFiles(IEnumerable`1 files)
   at SignCheck.SignCheck.Run()

Details
I'm using SignCheck 1.0.0-beta.18558.2

cc @joeloff

@joeloff
Copy link
Member

joeloff commented Nov 8, 2018

Is it running multiple instances of the SignCheck?

@natemcmaster
Copy link
Contributor Author

No. It looks like the same process attempts to open the same file multiple times.

image

@joeloff
Copy link
Member

joeloff commented Nov 8, 2018

What happens if you switch to using the shortform parameters, e.g. -e instead of error-log-file? Also, for the input files, if you're giving it a folder, try something like c:\foo*.* and pass -t to scan sub-folders.

I need to check, but I can't recall if it will just scan the files in the folder automatically. That might be a bug.

@joeloff
Copy link
Member

joeloff commented Nov 8, 2018

Ignore my last comment. I tried the internal version I wrote for WebTools and it's happy with just root folders for the input files. I'll take a look at what's going on here

@natemcmaster
Copy link
Contributor Author

What happens if you switch to using the shortform parameters, e.g. -e instead of error-log-file?

Same error.

@natemcmaster
Copy link
Contributor Author

I think I understand why. If the log is in the directory being recursively searched, the tool attempts to open the log file to check for signing.

@joeloff
Copy link
Member

joeloff commented Nov 8, 2018

Ah, yeah, that might be an issue. I can set up a PR to make sure the error log itself is always excluded.

joeloff added a commit that referenced this issue Nov 9, 2018
joeloff added a commit that referenced this issue Nov 9, 2018
@joeloff joeloff closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants