You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fish: Job 1, './target/debug/deps/iota_strong…' terminated by signal SIGSEGV (Address boundary error)
Regarding case 2: The current stronghold code uses try_lock everywhere, which means that if a lock cannot be acquired immediately, an error is returned to a user. In my opinion, this should be changed to a lock call, i.e. the call should block until the lock can be acquired. It should not be the stronghold user's responsibility to implement retry behaviour. This error was the original cause for writing the above test, which turned out to result in other behaviour, too.
The issue seems to come from Stronghold::load_client invocations, and in turn from the Snapshot::get_state call, which calls KeyStore::get_key. I think somewhere in that code area, the issue originates from, though I did not track it any further. The call to the store can be replaced with a procedure execution and will result in the same behaviour, so that specific line is most likely not the cause of the errors.
The text was updated successfully, but these errors were encountered:
As we discussed earlier, using mutexes / locks was intended to be only a temporary solution. try_lock() was used as an mechanism to always fail with an error, instead of running into deadlocks with lock()
thread '' panicked at 'Releases exceeded retains', engine/runtime/src/boxed.rs:188:9
This is a race condition.
With rust >= 1.61.x the currently employed std::sync::Mutex are denied by clippy, because this MutexGuard is held across an await point.
Solving this bug would either require proof of absence of dead locks, or finalizing the stm based approach.
I can confirm the test I attached in the issue runs (with minimal changes due to the changed interface, i.e. replacing load_client with get_client) and the example that we deactivated due to this issue also runs. Thank you!
Bug description
Multi-threaded code that uses
Stronghold::load_client
panics in various ways, depending on some parameters.Rust version
Which version of Rust are you running?
Stronghold version
Which version of Stronghold are you using?
Current
dev-refactor
branch, commit:629466da
.Hardware specification
What hardware are you using?
If hardware details are important, I'm happy to provide them.
Steps To reproduce the bug
Explain how the maintainer can reproduce the bug.
Run the following test multiple times. On my machine, the results were different across executions.
Expected behaviour
Test always finishes successfully, i.e. without panics.
Actual behaviour
I observed 5 different results:
Result::unwrap()
on anErr
value: LockAcquireFailed', client/src/tests/interface_tests.rs:162:60~/git/stronghold.rs/target/debug/deps/iota_stronghold-18f1a25c50491033 test_stronghold_multi_threading --nocapture
(signal: 11, SIGSEGV: invalid memory reference)Regarding case 2: The current stronghold code uses
try_lock
everywhere, which means that if a lock cannot be acquired immediately, an error is returned to a user. In my opinion, this should be changed to alock
call, i.e. the call should block until the lock can be acquired. It should not be the stronghold user's responsibility to implement retry behaviour. This error was the original cause for writing the above test, which turned out to result in other behaviour, too.The issue seems to come from
Stronghold::load_client
invocations, and in turn from theSnapshot::get_state
call, which callsKeyStore::get_key
. I think somewhere in that code area, the issue originates from, though I did not track it any further. The call to the store can be replaced with a procedure execution and will result in the same behaviour, so that specific line is most likely not the cause of the errors.The text was updated successfully, but these errors were encountered: