BTW, clean start of 0.4.0.3-alpha brings another problem:
Mar 28 08:26:00.000 [warn] Failed to unlink C:\Users\Vort\AppData\Roaming\tor\unverified-microdesc-consensus: Permission denied
Does this issue happen with an empty data directory?
Or does it only happen when unverified-microdesc-consensus exists?
I'm assigning this ticket to ahf, because he has a working Windows box with Tor.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
Annoyingly, we have this message in three different places in networkstatus.c, all in networkstatus_set_current_consensus(). We also give this error from src/lib/fs/files.c in finish_writing_to_file(). As a first step it might be good to figure out where this is happening from.
Tried to debug this on Linux to see what could cause the file to remain opened at the time of the call to unlink(). On Linux the following system calls are made around the problematic time of execution:
On Windows the tor_mmap_file() function will keep the file open until we call tor_munmap_file(). This is a problem in reload_consensus_from_file() since we will do the following:
mmap() the unverified-microdesc-consensus file.
Call networkstatus_set_current_consensus() with the content of the memory mapped file
networkstatus_set_current_consensus() will call unlink() on unverified-microdesc-consensus, which is still open because of (1) and will thus fail.
We will munmap() the file again when networkstatus_set_current_consensus() returns to reload_consensus_from_file().
I'm not sure what a good solution would be here. We need to either get rid of the mmap() call or lift the call to unlink() out of the block of code where the file that is to be unlinked is still memory mapped.
One option is to avoid using mmap(), but use read_file_to_str(). I think though that we moved to mmap() in this code to be more gentle with memory usage for iOS. Maybe we can use read_file_to_str() for Windows only, or?