Open Bug 840435 Opened 13 years ago Updated 3 years ago

PR_APPEND is racy on windows

Categories

(NSPR :: NSPR, defect)

All
Windows 7
defect

Tracking

(Not tracked)

People

(Reporter: glandium, Unassigned)

References

Details

On Windows, _PR_HAVE_O_APPEND is not defined, so PR_Write does a PR_Seek64(fd, 0, PR_SEEK_END) before doing the actual write. This is racy when multiple threads or processes append to the same file. Instead, CreateFile should be called with FILE_APPEND_DATA. http://msdn.microsoft.com/en-us/library/aa363858%28VS.85%29.aspx
Thank you for the bug report. I worked on this before in bug 545650 and even wrote a patch (bug 545650 comment 81). But I abandoned that patch after I discovered a problem with FILE_APPEND_DATA (see bug 545650 comment 87). I also found an alternative solution (bug 545650 comment 83), but I didn't pursue that.
QA Contact: jjones

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: wtc → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.