No Branch/Tag Specified
arm
asyncnotedecryption
danger
dev
dev-aarch64
dev-mac
dev-old-randomx
divzaddrs
dragonx
duke
freebsd
getfilterednotes
hip39
hushutils
insync
jahway603
master
mvstuff
onryo
p2p_privacy
ramhash
relaytx
rx-largepages
setbestchain
warmup
witness_cache
wolfssl
wolfssl_win
z_createrawtransaction
z_importwallet
z_signmessage
v0.11.2.z0
v0.11.2.z1
v0.11.2.z2
v0.11.2.z3
v0.11.2.z4
v0.11.2.z5
v0.11.2.z6
v0.11.2.z7
v0.11.2.z8
v0.11.2.z9
v1.0.0
v1.0.0-beta1
v1.0.0-beta2
v1.0.0-rc1
v1.0.0-rc2
v1.0.0-rc3
v1.0.0-rc4
v1.0.1
v1.0.10
v1.0.10-1
v1.0.11
v1.0.11-rc1
v1.0.12
v1.0.12-rc1
v1.0.13
v1.0.13-rc1
v1.0.13-rc2
v1.0.14
v1.0.14-rc1
v1.0.15
v1.0.15-rc1
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.0.7-1
v1.0.8
v1.0.8-1
v1.0.9
v1.1.0
v1.1.0-rc1
v1.1.1
v1.1.1-rc1
v1.1.1-rc2
v1.1.2
v1.1.2-rc1
v2.0.0
v2.0.0-rc1
v2.0.1
v3.0.0
v3.1.0
v3.1.1
v3.10.0
v3.10.1
v3.10.2
v3.2.0
v3.2.1
v3.2.1-alpha
v3.2.1-beta
v3.2.2
v3.2.3
v3.3.0
v3.3.1
v3.3.2
v3.4.0
v3.4.1
v3.5.0
v3.5.1
v3.5.2
v3.6.0
v3.6.1
v3.6.2
v3.6.3
v3.7.0
v3.7.1
v3.8.0
v3.9.0
v3.9.1
v3.9.2
v3.9.3
v3.9.4
Labels
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it testing
related to testing tor
related to tor wontfix
this won't be fixed
Apply labels
Clear labels
0-500 bounty
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it testing
related to testing tor
related to tor wontfix
this won't be fixed
No Label
0-500 bounty
2001-5000 bounty
501-2000 bounty
arm
beginners
bug
build
documentation
feature
high priority
i2p
low priority
medium priority
question
release
testing
tor
wontfix
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This issue currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch '%!s(MISSING)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
Seems like a rare edge case, possibly from corrupt data on disk :
In any case, this kind of error should not coredump hushd.
This happened on Debian 11. Also possibly related:
I am also seeing this assertion a few times now on latest dev branch running stratum. Never seen it before. Also Debian 11. Maybe from BIP155 changes.
@fekt this error has to do with peers.dat file on disk being potentially corrupted from a previous crash. If you are running into it more than once, I suggest saving the peers.dat to a new file so we can inspect/debug with it, and let hushd make a brand new peers.dat . This may incur a few extra minutes of downtime when hushd starts up when it populates a new peers.dat file.
To explain more, we inherited this code from BTC and what it appears to do is enforce that a given peer id only appears once in peers.dat, i.e. the same peer unique id should not appear more than once in the file. This is usually the case, but it seems like it's possible for it to happen, possibly if hushd crashes.
Like I say,
assert()
's in full node code are a bad design practice that both BTC/ZEC subscribe to, instead, we should make the code do the best it can to continue. In this case, we should probably delete duplicate id's until there is only one. Deleting a peer from peers.dat has almost no downside (it will just be re-added later if it was supposed to be there) but crashing the node because peers.dat is slightly inconsistent is horrific behavior.I guess I mentioned this originally on TG a couple months ago and didn't remember.
Node last coredumped yesterday and peers.dat not modified since 4/17. I tried dumping and reading with this script, but it gives an invalid header error: https://github.com/asood123/bitpeers
I tried deleting peers.dat, restarted node and let it create a new one, and then stopped node. Tried reading that peers.dat and get an invalid header as well. Could be that python script is too old. Not sure.
I attached the peers.dat from last coredump.
@fekt that script looks interesting and yeah, it seems to be from before BTC merged BIP155. You can tell because the invalid header error asserts that
version=1
https://github.com/asood123/bitpeers/blob/master/bitpeers.py#L237 which is the old pre-BIP155 peers.dat format version. Still, the script looks useful and can likely be updated to support the latest version with a few lines of changes.The next step is to improve the mapInfo.count assertion and make it actually report which
nId
has duplicates, and how many. The code should delete duplicatenId
entries instead of doing anassert()
@fekt I realized the issue is not duplicates, since
mapInfo
is astd::map
which only allows a single value for a key. The issue is the code is not finding any key with valuenId
. I changed the code to log the issue to STDERR with no assertion and to try the next iteration of the loop, since it is randomly choosing values anyway. I will test it on theduke
branch and if it doesn't make things worse I will migrate it to thedev
branch.@duke sounds good. i have it running on a box now and will update if anything worthy.
This is still running fine and hasn't crashed. I just installed
duke
branch on lite2.hushpool.is because that kept crashing with same assert.lite2.hushpool.is crashed with this now
addrman.cpp:153: void CAddrMan::SwapRandom(unsigned int, unsigned int): Assertion 'it_1 != mapInfo.end()' failed.
@fekt thanks for reporting. I only removed some assertions because I never saw any of the others happen, but now that those are removed, it's possible that other assertions are now being triggered.
If/when we close #297, this issue should be closed as well
@duke should this issue be closed as issue #297 was closed?
seems to be fixed, closing