Closed clehner closed 8 years ago
Are you sure you're on the referenced commit? Because with that commit, the assertion should be <=
instead of <
.
@lgierth the line that failed is a different line than the one with the assertion that was changed in that commit. https://github.com/hyperboria/cjdns/blob/a05ade40dc31caebaf3aa770aac3ab2ecb02d867/dht/dhtcore/NodeStore.c#L651
Ah I see! Then I guess try changing it there too ;)
The segfault is caused by trying to access node->reach_pvt in Node_getReach when node is null. I could add a null check in handleNews or Node_getReach, but I don't know what it means for it to be null in the first place. Is that expected or does it indicate a bug somewhere else? Going up the stack, the null node passed to handleNews is the result of link->child in NodeStore_discoverNode. link is returned from discoverLink. I can't check other fields of link because gdb says the value is optimized out. The only places where ->child is assigned to a Node_Link are linkNodes and NodeStore_unlinkNodes. So I think either discoverLink is returning something bad, or the link is being used after being unlinked.
Reach has been replaced by the cost metric, so I assume this segfault is gone.
in a05ade40dc31caebaf3aa770aac3ab2ecb02d867 (master):