Opened 8 months ago

Closed 7 months ago

#21129 closed defect (fixed)

Bug: src/or/entrynodes.c:1204: remove_guard_from_confirmed_and_primary_lists: Non-fatal assertion !(guard != found_guard) failed.

Reported by: asn Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.0.x-final
Component: Core Tor/Tor Version: Tor: 0.3.0.1-alpha
Severity: Normal Keywords: tor-guard
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Similar to #21128, I was messing around with my state file to simulate various guard scenarios, and I ended up getting the following non-fatal assert. This happened when I replaced confirmed_on=2016 with confirmed_on=2014 and sampled_on=2016 with sampled_on=2014 in my state file, so that I test guard expiry:

Jan 03 14:20:52.000 [warn] Removing sampled guard quadhead ($BF0FB582E37F738CD33C3651125F2772705BB8E8): it was sampled over 120 days ago, and confirmed over 60 days ago.
Jan 03 14:20:52.000 [warn] tor_bug_occurred_(): Bug: src/or/entrynodes.c:1204: remove_guard_from_confirmed_and_primary_lists: Non-fatal assertion !(guard != found_guard) failed. (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug: Non-fatal assertion !(guard != found_guard) failed in remove_guard_from_confirmed_and_primary_lists at src/or/entrynodes.c:1204. Stack trace: (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /usr/lib/x86_64-linux-gnu/libasan.so.1(backtrace+0x3a) [0x7fb92745b48a] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(log_backtrace+0x46) [0x7fb928e1b806] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(tor_bug_occurred_+0x12f) [0x7fb928e6b6df] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(entry_guards_update_all+0x12f2) [0x7fb928de5b82] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(guards_update_all+0x83) [0x7fb928dea8e3] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(directory_info_has_arrived+0xa5) [0x7fb928aa8fe5] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(do_main_loop+0x17b) [0x7fb928aa9b6b] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(tor_main+0x1385) [0x7fb928aaebc5] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(main+0x1c) [0x7fb928a9cddc] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fb924f35b45] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)
Jan 03 14:20:52.000 [warn] Bug:     /home/user/tor-browser_en-US/Browser/TorBrowser/Tor/tor(+0x574e9b) [0x7fb928a9ee9b] (on Tor 0.3.0.0-alpha-dev 5a97a46e60c95b6f)

Seems like some assumption is not true during guard removal. Please let me know if you think my manual state string replacements might have put Tor into some unrealistic state and hence this bug is bogus.

Child Tickets

Change History (7)

comment:1 Changed 7 months ago by nickm

Owner: set to nickm
Status: newaccepted

comment:2 Changed 7 months ago by nickm

Hm. Replacing confirmed_on alone is not enough to reproduce this, but I can reproduce too when I also change sampled_on.

comment:3 Changed 7 months ago by nickm

Jan 31 14:20:23.000 [warn] tor_bug_occurred_: Bug: src/or/entrynodes.c:1119: remove_guard_from_confirmed_and_primary_lists: Non-fatal assertion !(guard != found_guard) failed. (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug: Non-fatal assertion !(guard != found_guard) failed in remove_guard_from_confirmed_and_primary_lists at src/or/entrynodes.c:1119. Stack trace: (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(log_backtrace+0x41) [0x557897b732d1] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(tor_bug_occurred_+0xff) [0x557897b8ad0f] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(entry_guards_update_all+0xab2) [0x557897b60822] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(entry_guards_parse_state+0xff3) [0x557897b62433] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(or_state_load+0x321) [0x557897acdc71] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(set_options+0xc5d) [0x557897b0194d] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(options_init_from_string+0x3d4) [0x557897b09054] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(options_init_from_torrc+0x2ea) [0x557897b0830a] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(tor_init+0x350) [0x557897a6b8a0] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(tor_main+0x53) [0x557897a6bef3] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(main+0x13) [0x557897a67c23] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     /lib64/libc.so.6(__libc_start_main+0xf1) [0x7f982f0cf401] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)
Jan 31 14:20:23.000 [warn] Bug:     ./src/or/tor(_start+0x2a) [0x557897a67b0a] (on Tor 0.3.0.2-alpha-dev 09a00a2f826233b4)

comment:4 Changed 7 months ago by nickm

Likely fix as bug21129. The confirmed_idx field could become invalid if we expired two guards in the same loop.

comment:5 Changed 7 months ago by nickm

Status: acceptedneeds_review

comment:6 Changed 7 months ago by asn

Status: needs_reviewmerge_ready

Patch looks good to me and seems to fix the bug based on my testing. Thanks for fix :)

comment:7 Changed 7 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Thanks; merged!

Note: See TracTickets for help on using tickets.