Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#2504 closed defect (fixed)

When locking a file on windows, EACCESS tells us we have it locked already, not EDEADLOCK

Reported by: Sebastian Owned by:
Priority: Medium Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Bug noticed by mobmix on #tor, msdn description on http://msdn.microsoft.com/en-us/library/8054ew2f(v=vs.80).aspx

remaining question I want to answer for myself is what happens when we already hold the lock and try to blockingly lock it again (do we get EACCESS like I hope or do we get EDEADLOCK)

Child Tickets

Change History (9)

comment:1 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-final

comment:2 Changed 9 years ago by Sebastian

Trying this on a Windows 7, unfortunately I'm getting "Permission denied" when we're trying to non-blockingly lock a file we have locked before, and a "Resource deadlock avoided" error when trying to lock a file we've already locked blockingly (the errors are the same when some other process has the files locked); so it does unfortunately look like simply replacing EDEADLOCK with EACCES won't do. My next-best approach would be to say that if either EACCES or EDEADLOCK is returned we use the error case.

comment:3 Changed 9 years ago by Sebastian

Status: newneeds_review

implementation in bug2504 in my repo

comment:4 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

looks ok to me. merging.

comment:5 Changed 9 years ago by Sebastian

Resolution: fixed
Status: closedreopened

ugh. commit msg correctly stated it is EACCES but the code had EACCESS. Fixed in updated branch bug2504 in my repo. Also includes a changes file now.

comment:6 Changed 9 years ago by Sebastian

Status: reopenedneeds_review

and I need to add another comment to put this into needs-review again

comment:7 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

merged; thanks!

comment:8 Changed 7 years ago by nickm

Keywords: tor-client added

comment:9 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.