Opened 4 years ago

Closed 4 years ago

#18392 closed defect (fixed)

windows build failures

Reported by: weasel Owned by:
Priority: High Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Major Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


So, nick pointed out that the windows builds have been failing on master. Apparently something to do with temp directoryes:

make  check-TESTS
make[1]: Entering directory `/c/cygwin/home/jenkins/weasel-temp/build-tree'
rm -f micro-revision.tmp; \
        if test -d "../tor/.git" && \
                        test -x "`which git 2>&1;true`"; then \
                HASH="`cd "../tor" && git rev-parse --short=16 HEAD`"; \
                echo \"$HASH\" > micro-revision.tmp; \
        fi; \
        if test ! -f micro-revision.tmp; then \
                if test ! -f micro-revision.i; then \
                        echo '""' > micro-revision.i; \
                fi; \
        elif test ! -f micro-revision.i || \
                        test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
                mv micro-revision.tmp micro-revision.i; \
        fi; \
        rm -f micro-revision.tmp; \
Failed to set initial options: Couldn't access/create private data directory "C:\cygwin\tmp\tor_test_1920_kq7xphqj"
FAIL: src/test/test.exe
Failed to set initial options: Couldn't access/create private data directory "C:\cygwin\tmp\tor_test_3208_bbamnh5w"
FAIL: src/test/test-slow.exe
It appears that memset is good enough on this platform. Good.
OKAY: memwipe seems to work.
PASS: src/test/test-memwipe.exe

Child Tickets

Change History (6)

comment:1 Changed 4 years ago by weasel

I have bisected this on our windows build host, and it seems that the following commit is the one first showing this:

$ git bisect bad
f48c607fd970aedaf0180a0a23b04eb5101abca0 is the first bad commit
commit f48c607fd970aedaf0180a0a23b04eb5101abca0
Author: Jeremy <>
Date:   Tue Dec 8 13:25:15 2015 -0500

    Harden check_private_dir() to remove any potential race.
    Remove any potential race between stat() and chmod().
    Replace stat() with fstat().
    Replace chmod() with fchmod()

:040000 040000 7cc8d63139975a0e5beb13347c2afc8282cd2d4e 3da2265493282643f73060aaa7677ac467cf5d84 M      src

(Note that I built with -DO_NOFOLLOW=0 to work around the build issue fixed in 1e99508)

The previous one, 4e19133 builds and tests fine.

comment:2 Changed 4 years ago by weasel

master builds and tests fine when using check_private_dir() from 4e19133.

comment:3 Changed 4 years ago by nickm

Ah hmm. Apparently Windows won't let you open() a directory. From :


Tried to open a read-only file for writing, file's sharing mode does not allow the specified operations, or the given path is a directory.

comment:4 Changed 4 years ago by nickm

Priority: MediumHigh
Severity: NormalMajor
Status: newneeds_review

I've got a fix for this as bug18392 in my public repository. Needs review; haven't been able to test on Windows yet. (Am at an airport.)

comment:5 Changed 4 years ago by harig

Just a note: After applying 7255b1121d8c, I am able to start and run tor; there is no directory read error. There is one warning on compilation:

src/common/util.c:2059:7: warning: unused variable 'fd' [-Wunused-variable]

int fd;

comment:6 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Okay; sounds reasonable. Merging, with a fix for the issue that harig notes above.

Note: See TracTickets for help on using tickets.