Closed theduke closed 4 years ago
Hi @theduke , did you call the zbox::init_env
function at the beginning? It is essential to get libsodium work.
That was it.
Does libsodium
provide a API to determine if it has been initialized?
If so you could check and panic
with a more informative message.
I don't think libsodium
provided that API nor I think it is necessary. That initialize function is supposed to run once before any others, and it can be called multiple times. Like any other libraries, that is just one-off task and should keep simple as possible. So I cannot see any necessities to have a such API.
The point is for zbox to check if the initialization was already done before opening a repo and panick, or alternatively to auto-initialize when creating the repo.
A SIGABRT is not something that should happen in a Rust library, so I'd consider this a API zbox API design issue.
I can't see any reason need to check the initialization status, simply call that function in your program's initialize code and then forget about it, it isn't that hard I think.
It's not that hard, but a Rust library that can SIGABRT with regular usage just has a bad API design imo.
Just close this issue, because this behavior is consistent with libsodium which will also SIGABRT when not initialized.
I'm getting a SIGABRT on opening a repo. The error happens both with
libsodium-bundled
and with the systemlibsodium
.Host: Arch Linux Zbox:
0.8.3