Opened 7 years ago

Closed 7 years ago

#8822 closed defect (fixed)

Microdescriptor cache fails (Tor can't write to it)

Reported by: bastik Owned by:
Priority: High Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version: Tor: 0.2.4.12-alpha
Severity: Keywords: tor-client
Cc: david.carlson.417@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tor Software Error - The Tor software encountered an internal bug. Please report the following error message: "microdesc_cache_rebuild(): Bug: Discontinuity in position in microdescriptor cache.By my count, I'm at 1760119, but I should be at 1760185
"
Attached you see the log of Vidalia (what is left).
It's a bridge (0.2.4.12) running on Windows 7.

I never saw this error before.

My normal reaction is restart the damn thing, but the bug says I should report it. (I don't see errors at all).

Tor has permission to write to the folder it attempts to. I can't see anything locking the file. Tor has created the file previously and there's only one Tor instance running.

Child Tickets

Attachments (3)

log2013-05 .txt (12.4 KB) - added by bastik 7 years ago.
complete log
log2013-05-07.txt (12.8 KB) - added by bastik 7 years ago.
error appears again
Process Monitor log.CSV (3.6 KB) - added by bastik 7 years ago.

Download all attachments as: .zip

Change History (20)

Changed 7 years ago by bastik

Attachment: log2013-05 .txt added

complete log

comment:1 Changed 7 years ago by bastik

Status: newneeds_information
Summary: Microdescriptor cache failsMicrodescriptor cache fails (Tor can't write to it)
Version: Tor: 0.2.4.12-alpha

I let Tor repeat this error over and over again and did not stop it as is wasn't showing any connectivity/usage problems.

Today I launched it again and Vidalia logged the errors again, so I stopped Tor.

I went to %APPDATA%\Tor and removed the following files

  • cached-microdescs (The one Tor can't write to)
  • cached-microdescs.new (I saw this file before, removed to have it fresh)
  • cached-microdescs.tmp (I can't remember to have since such a file before, removed to have it fresh)

History

  • cached-microdescs created 2012-05-19, changed 2013-04-28, accessed 2013-04-28
  • cached-microdescs.new created 2012-05-19, changed 2013-05-05, accessed 2013-04-28
  • cached-microdescs.tmp created 2013-05-04, changed 2013-05-05, accessed 2013-05-04

(So I was correct .tmp was never there before)

All files shared the same access-privileges.

I restarted Tor and it created the first two files. No error since then.

The files created share the same access-privileges and are the same as there were before. Since I had not seen this error during the alpha-phase of branch 0.2.4.x I change the version to 0.2.4.12-alpha.

The strange about this issue is that I upgraded from .11 to .12 on 2013-04-30 and the error appeared on 2013-05-04, never before. Might be that it takes Tor some time to gather enough microdescriptors to exhibit this.

I change to "needs more information" and wait to see if it occurs again in which case I report back or ask if we can close this ticket otherwise.

Changed 7 years ago by bastik

Attachment: log2013-05-07.txt added

error appears again

comment:2 Changed 7 years ago by bastik

Status: needs_informationnew

The error showed up yesterday. (Bridge was not started today)

Mai 07 21:52:06.796 [Warning] Error replacing "C:/Users/[username]/AppData/Roaming/tor\cached-microdescs": Permission denied
Mai 07 21:52:06.796 [Warning] Error rebuilding microdescriptor cache: Permission denied

Strangely Tor fails to update the file that was created by the same binary.

Beside the files Tor created before Tor created "cached-microdescs.tmp" again.

History

  • cached-microdescs created 2013-05-05, changed, 2013-05-05, accessed 2013-05-05
  • cached-microdescs.new created 2013-05-05, changed 2013-05-07, accessed 2013-05-05
  • cached-microdescs.tmp created 2013-05-07, changed 2013-05-07, accessed 2013-05-07

I'm not logging to disk so the provided logs might be not so useful.

comment:3 Changed 7 years ago by nickm

I wonder, could this be another instance of #2077 ? If so, does any of the discussion there seem relevant?

comment:4 Changed 7 years ago by nickm

(There were at least two bug discussed on #2077; I mean the one that so far is outstanding.)

comment:5 in reply to:  3 Changed 7 years ago by bastik

Replying to nickm:

I wonder, could this be another instance of #2077 ? If so, does any of the discussion there seem relevant?

Looks like this would be the same issue. I'm not sure what's relevant. However based on the ticket I can give the following information:
File flags for %APPDATA%\Tor (I don't know how they are named in English versions of Windows)
write-protected/read-only: not set
hidden: not set
archiv: set (file can be backed-up)
index content: not set
compress content: not set
encrypt content: not set (grayed out, not available)

I (disabled publishing my descriptor and) started Tor.
[...]
Mai 09 08:23:49.039 [Warning] Error replacing "C:/Users/[username]/AppData/Roaming/tor\cached-microdescs": Permission denied
Mai 09 08:23:49.039 [Warning] Error rebuilding microdescriptor cache: Permission denied

I launched ProcessMonitor (before I launched Tor) to provide information what accesses these files. I'll attach an excerpt of what was logged. Tor could write to .tmp, but could not remove the "cached-microdescs" file. CANNOT DELETE. There's no race between two processes accessing the file(s).

I never had this error prior to 0.2.4.12-alpha and wonder if there was change.
#8037 is mentioned in the change-log. I don't see what would cause this.

Changed 7 years ago by bastik

Attachment: Process Monitor log.CSV added

comment:6 Changed 7 years ago by bastik

In order to start the bridge without errors I removed the files once again.

comment:7 Changed 7 years ago by nickm

Closed #8883 as a duplicate of this

comment:8 Changed 7 years ago by LoneRanger1012

Cc: david.carlson.417@… added

comment:9 Changed 7 years ago by bastik

#8922 is a possible duplicate.

It's for sure a duplicate of #8883.

I never saw:
[Warning] Gzip returned an error: stream error
[Warning] write_to_buf failed. Closing connection (fd -1).
in my logs. Those lines are not in the logs I attached (unless I overred them). I can't remember to have seen them.

comment:10 Changed 7 years ago by nickm

Resolution: duplicate
Status: newclosed

comment:11 Changed 7 years ago by nickm

Resolution: duplicate
Status: closedreopened

comment:12 Changed 7 years ago by nickm

This is not, as I'd thought, a dup of #2077 or anything else. It's a duplicate of an old bug that never got a number which we fixed in bdff7e3299d78cd2f7aa4a31e5f57c1aeef5ffa1 but reintroduced in 6905c1f6.

comment:13 Changed 7 years ago by nickm

Keywords: tor-client added
Milestone: Tor: 0.2.4.x-final
Priority: normalmajor

comment:14 Changed 7 years ago by nickm

Status: reopenedneeds_review

Please review branch "bug8822". I'm testing it now.

comment:15 Changed 7 years ago by nickm

I can confirm that this makes my unit test pass.

comment:16 Changed 7 years ago by andrea

Fix looks good to me if it passes tests.

comment:17 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Great, merged!

Note: See TracTickets for help on using tickets.