Opened 13 years ago

Last modified 7 years ago

#308 closed defect (Fixed)

confused by clock skew, doesn't start [debian #354259]

Reported by: weasel Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: weasel, arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi!
first thanks for your effort in tor! It's great!
from time to time I have my hw clock resetted back to 1904 if I leave my
laptop without battery, tor gets confused and won't start:

Jan 01 01:24:26.452 [notice] Tor 0.1.1.12-alpha opening log file.
[...working normally here...]
Jan 01 01:24:28.608 [warn] router_set_networkstatus(): Network status
from directory server "moria1" at 18.244.0
.188:9031 was published in the future (2006-02-24 12:05:52 GMT).
Somebody is skewed here: check your clock. Not
caching.

but warping the clock to the future isn't liked by tor who eats almost
all the cpu. Then I try to restart it:

Feb 24 14:41:09.619 [notice] Tor 0.1.1.12-alpha opening log file.
Feb 24 14:41:09.619 [warn] parse_iso_time(): Got invalid ISO time
"1904-01-01 00:39:26". (Before 1970)
Feb 24 14:41:09.620 [warn] Invalid time '1904-01-01 00:39:26' for
keyword 'BWHistoryReadEnds'
Feb 24 14:41:09.620 [err] set_options(): Acting on config options left
us in a broken state. Dying.

that is, it stores dates it can't parse back :)

Ooops, I'm sorry I have missed this bug report. I'm forwarding it to
the developers for their attention.

tor-bugs, please CC 354259@… on future mails about that
bug.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (4)

comment:1 Changed 13 years ago by arma

This is easy to fix for this specific case: I've just committed a change that will
try to re-parse them before it writes them, in this case.

But I'm going to leave the flyspray open, since there are a few other cases like this,
e.g. when we write LastWritten to the state file.

Should we change format_[local_]iso_time so it tries to reparse what it produces, and
fails if it can't? I guess the faster approach is just to check if the seconds are
within bounds. And then we'd rewrite the places where we format iso times to check for
failure.

comment:2 Changed 13 years ago by nickm

The more general problem here isn't time; it's data in general. If we can't parse a line in
line in the state file, we should reset it (or possibly reset the whole logical unit, or the
whole file) to a safe default, and warn the user.

comment:3 Changed 13 years ago by nickm

flyspray2trac: bug closed.
Fixed in subversion repository as of r8224. Fix will appear in next alpha release.

comment:4 Changed 7 years ago by nickm

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