Closed neilalexander closed 3 years ago
This is fine, these are disposable keys and it doesn't make sense to diagnose SIGSEGV if half of the data is redacted :)
This is fine, these are disposable keys and it doesn't make sense to diagnose SIGSEGV if half of the data is redacted :)
Best to let us know if they are throwaway keys so that we won’t redact them :-)
Ok no problem. This might be related to private/public key formatting or mismatch (we had one issue like this in the past if you remember). I've added the whole offending config here https://paste.sr.ht/%7Ekravietz/5235f773912d2e06072ef9a24fae0aecf9fb9044 all keys are disposable :)
Thanks @kravietz, this seems to be caused by a mismatch in private/public encryption keys. If I make a config with only those keys (and nothing else), it crashes. If I use the config and comment out those lines (so it generates new keys), there's no crash.
But that's not a helpful error message. Our problem is here: https://github.com/yggdrasil-network/yggdrasil-go/blob/d160eccab00443187e2343c707c60f37c7fbcfde/src/yggdrasil/core.go#L163
If Core._init
returns an error (due to bad keys, I guess) then it doesn't make it far enough to run switchTable.init
, so switchTable.core
remains nil
. Then when we segfault when we try to reach the logger via the (nil
) core here: https://github.com/yggdrasil-network/yggdrasil-go/blob/d160eccab00443187e2343c707c60f37c7fbcfde/src/yggdrasil/switch.go#L582
So I think all we can do here is check for an error from Core._init
, log it better, and shut down gracefully somehow.
Reported by @kravietz, reposted without private keys and other potentially sensitive data.
With the following config file (perhaps some syntax errors are causing it but it shouldn't SIGSEGV anyway):