Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#3361 closed defect (fixed)

tor-0.2.3.1 segfault in networkstatus_set_current_consensus

Reported by: mart.bakhoff Owned by: nickm
Priority: High Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

tor segfaults on startup on gentoo amd64 hardened. i'm using it with vidalia, relay enabled.

Program received signal SIGSEGV, Segmentation fault.
0x0000007b44fd05cd in networkstatus_set_current_consensus (

consensus=0x7b45811820 "network-status-version 3 microdesc\nvote-status consensus\nconsensus-method 11\nvalid-after 2011-06-07 13:00:00\nfresh-until 2011-06-07 14:00:00\nvalid-until 2011-06-07 16:00:00\nvoting-delay 300 300\nclient"..., flavor=0x7b450f6281 "microdesc", flags=5) at networkstatus.c:1815

Child Tickets

Attachments (2)

gdb-backtrace.txt (1.2 KB) - added by mart.bakhoff 6 years ago.
backtrace
ls-tor.txt (817 bytes) - added by mart.bakhoff 6 years ago.
ls -l ~/.tor

Download all attachments as: .zip

Change History (12)

Changed 6 years ago by mart.bakhoff

Attachment: gdb-backtrace.txt added

backtrace

Changed 6 years ago by mart.bakhoff

Attachment: ls-tor.txt added

ls -l ~/.tor

comment:1 Changed 6 years ago by nickm

Milestone: Tor: 0.2.3.x-final
Owner: set to nickm
Priority: normalmajor
Status: newassigned

Looks like the current_consensus result is NULL in

  if (now < current_consensus->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {

This happens because the consensus we just set wasn't the one we were going to use. Options seem to be checking whichever consensus we just got, or checking the result for NULL.

comment:2 Changed 6 years ago by nickm

Status: assignedneeds_review

Possible fix in branch bug3361 in my public repository; needs quick review.

comment:3 Changed 6 years ago by Sebastian

that was my idea too. Does it work for you, mart?

comment:4 Changed 6 years ago by mart.bakhoff

I did some testing with nickm's patch:
1) when I clear my .tor/cached* files, tor starts with or without the patch.
2) using my cache files from (I think) tor-0.2.2.25:
2.1) without the patch: segfault in networkstatus_set_current_consensus
2.2) with the patch: segfault in microdesc_cache_rebuild

Did I hit a new bug? Or is my cache just really messed up? I can upload my cache files and backtrace for microdesc_cache_rebuild thing if that's any help.

comment:5 in reply to:  4 Changed 6 years ago by rransom

Replying to mart.bakhoff:

I did some testing with nickm's patch:
1) when I clear my .tor/cached* files, tor starts with or without the patch.
2) using my cache files from (I think) tor-0.2.2.25:
2.1) without the patch: segfault in networkstatus_set_current_consensus
2.2) with the patch: segfault in microdesc_cache_rebuild

Did I hit a new bug? Or is my cache just really messed up? I can upload my cache files and backtrace for microdesc_cache_rebuild thing if that's any help.

Backtraces are always helpful. We may or may not need your cache files, but please compress those first if you upload them to Trac.

comment:6 Changed 6 years ago by nickm

Status: needs_reviewassigned

Sounds like a new bug to me. I've merged bug3361. The cache files and backtrace would probably be helpful.

One more thing to check, though: Can you tell if the second bug occurs in git master? I think we might have made some fixes around that code since 0.2.3.1-alpha came out.

comment:7 in reply to:  6 Changed 6 years ago by mart.bakhoff

Resolution: fixed
Status: assignedclosed

Replying to nickm:

Sounds like a new bug to me. I've merged bug3361. The cache files and backtrace would probably be helpful.

One more thing to check, though: Can you tell if the second bug occurs in git master? I think we might have made some fixes around that code since 0.2.3.1-alpha came out.

You were right! Latest git had microdesc_cache_rebuild fixed and your last commit fixed networkstatus_set_current_consensus. Everything seems to be working. Thanks!

comment:8 Changed 6 years ago by nickm

Great! Thanks again for testing all this stuff.

comment:9 Changed 5 years ago by nickm

Keywords: tor-client added

comment:10 Changed 5 years ago by nickm

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