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

Compiler and linker open some source files with exclusive access #4466

Closed
wixbot opened this issue Jul 8, 2014 · 5 comments
Closed

Compiler and linker open some source files with exclusive access #4466

wixbot opened this issue Jul 8, 2014 · 5 comments
Assignees
Milestone

Comments

@wixbot
Copy link

wixbot commented Jul 8, 2014

The compiler and linker open some source files with exclusive access instead of read-share access. This causes intermittent problems when performing multi-core builds. Any files that are only being read should be opened with read-share access so that multiple threads / processes can read the file simultaneously.

Originally opened by thomas.hammond

@wixbot
Copy link
Author

wixbot commented Jul 10, 2014

Please be more specific. Which source files? Which tools? Source files in the compiler are opened with read sharing. Have you looked at anti-virus interference?

@wixbot
Copy link
Author

wixbot commented Jul 11, 2014

I think it was coming from the linker when it was reading an ICO file to use as the package icon. After taking a closer look at the 3.8 code, it looks like there is only once place where this is happening (I thought there were more, but I was wrong), and it is stinging us randomly. Here is the offending line:

File: src\DTF\Libraries\Resources\GroupIconResource.cs: ~line 95 (ReadFromFile method)
-> using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read))

The default FileShare mode is None, so if one thread is reading the icon, no other threads can also open it for read. I think this needs to be changed so that other threads can read the file:
-> using (FileStream fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read))

Or it could just be changed to use File.OpenRead, which automatically uses FileShare.Read under the covers. This is what is done in many places for Wix read operations.

Originally posted by thomas.hammond

@wixbot
Copy link
Author

wixbot commented Jul 11, 2014

Thanks for narrowing it down!

Originally posted by barnson
Status changed from Open to Untriaged

@wixbot
Copy link
Author

wixbot commented Jul 17, 2014

Area changed from compiler to sdk
AssignedTo set to bobarnson
Release changed from v3.8 to v3.9

@wixbot
Copy link
Author

wixbot commented Jul 18, 2014

Originally changed by barnson
Resolution set to fixed
Status changed from Open to Resolved

@wixbot wixbot added this to the v3.9 milestone Dec 20, 2015
@wixbot wixbot closed this as completed Dec 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants