Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Comments

Projects
None yet
2 participants
Collaborator

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

Collaborator

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?

Collaborator

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

Collaborator

wixbot commented Jul 11, 2014

Thanks for narrowing it down!

Originally posted by barnson
Status changed from Open to Untriaged

Collaborator

wixbot commented Jul 17, 2014

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

Collaborator

wixbot commented Jul 18, 2014

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

@wixbot wixbot added bug sdk labels Dec 20, 2015

@wixbot wixbot added this to the v3.9 milestone Dec 20, 2015

@wixbot wixbot closed this Dec 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment