File descriptor leak in Firefox updater causes update failures
I'm getting some strange errors when running the updater on a very hacked-up version of Tor Browser on Linux. In one instance, I got "ensure_copy_recursive: path is not a directory: /home/user/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default/Cache/4/99, rv: 0, err: 24". In another (when I enabled app.update.logs) I got:
*** AUS:SVC Downloader:onProgress - progress: 53654724/53654724
*** AUS:SVC Downloader:onStopRequest - original URI spec: https://www.torproject.org/dist/torbrowser/4.5/tor-browser-linux64-4.5_en-US.mar, final URI spec: https://dis
t.torproject.org/torbrowser/4.5/tor-browser-linux64-4.5_en-US.mar, status: 0
*** AUS:SVC Downloader:onStopRequest - status: 0, current fail: 0, max fail: 10, retryTimeout: 2000
*** AUS:SVC Downloader:_verifyDownload called
*** AUS:SVC Downloader:_verifyDownload downloaded size == expected size.
*** AUS:SVC Downloader:_verifyDownload hashes do not match.
*** AUS:SVC Downloader:onStopRequest - download verification failed
*** AUS:SVC getStatusTextFromCode - transfer error: The integrity of the update could not be verified, code: verification_failed
*** AUS:SVC Downloader:onStopRequest - setting state to: download-failed
*** AUS:SVC Downloader:onStopRequest - all update patch downloads failed
Oddly, while trying to reproduce this more times, the update finally downloaded successfully and applied fine. This caused me to suspect a bad mirror, but that full MAR file seems fine on all mirrors.
I am out of ideas, and I have not been able to reproduce this issue on any vanilla TBB on the same systems, even if I force it to do a full update by editing the start-tor-browser script.