Closed senden9 closed 5 years ago
thank you @senden9. This is a bug in sqlite storage which handles SQL statements initialization order incorrectly. I will fix it soon.
Hi!
If I see it right the fix is is zbox 0.8.3. If i now try to run the code I can not open the repository (or a newly created one) because of an Error on opening. So it is less worse because i can catch the error but i can still not create & open an sqlite repo.
Stack-trace of the same code as above:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotFound', src/libcore/result.rs:999:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:197
3: std::panicking::default_hook
at src/libstd/panicking.rs:211
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:474
5: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:381
6: rust_begin_unwind
at src/libstd/panicking.rs:308
7: core::panicking::panic_fmt
at src/libcore/panicking.rs:85
8: core::result::unwrap_failed
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/macros.rs:18
9: core::result::Result<T,E>::unwrap
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/result.rs:800
10: crypting::main
at src/main.rs:10
11: std::rt::lang_start::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
12: std::panicking::try::do_call
at src/libstd/rt.rs:49
at src/libstd/panicking.rs:293
13: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:85
14: std::rt::lang_start_internal
at src/libstd/panicking.rs:272
at src/libstd/panic.rs:394
at src/libstd/rt.rs:48
15: std::rt::lang_start
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
16: main
17: __libc_start_main
18: _start
crypting::main
line 10 is
let mut repo = RepoOpener::new()
.create(true)
.open("sqlite://./myRepoSqlite", "your password")
.unwrap();
That issue is happened at the FFI boundary between rust and libsqlite. When binding eid as CString to SQL parameter, its life time isn't long enough so a dangling pointer is passed to libsqlite. It used to work on my mac, but I think it is largely by luck. I have worked out a fix, @senden9 could you try test it again and let me know if it is working? Thanks.
Used master branch as dependency (ed1a2cbf). Seem to work now :tada:
Hi!
I can create a sqlite backend file, open some files in it, read them and close. But i am not able to reopen the same sqlite file again. Then zbox crashes with the given error below. Somehow in a frame below the
RepoOpener
call.To reproduce simply execute the attached rust program two times.
It seems that I am able to use the file backend, but not the sqlite backend. If I replace
sqlite://./myRepoSqlite
withfile://./myRepo
it works. :thinking:.Dependencies:
Error:
Environment information:
Zipped Sqlite file for inspection: myRepoSqlite.zip