Open pacu opened 4 years ago
Reposing from slack:
I dove into the Futures code a little bit and really didn't understand any of it, but I noticed there's some thread-dependent code in that call stack: https://github.com/rust-lang/futures-rs/blob/0.1.29/src/task_impl/std/mod.rs#L483 (it's defined in a thread_local! above). If you look at the stack trace it repeats at the end, so my guess was it's recursively polling on something that never gets satisfied and then runs out of stack space. That's as far as I got and I definitely don't understand it so could be a red herring.
@pacu is there more information about the exception, like register values / assembly instruction that triggered it?
I'll gather those and post them here or ping you
I forced release mode for the build and everything started working. I guess that then it's the debug build which is broken? or maybe is it too heavy on the stack for iOS? who knows...
ONLY ON DEBUG MODE
reproduced on: note-spending-v5 and note-spending-v6
Context:
when calling
create_to_address
from unit tests, calls are made from the main thread and return successfully with the expected result (a transaction Id or an error message, like insufficient balance, etc)On integration tests or the iOS demo app, the
create_to_address
is called from a 'background' thread which does not block the main thread (which handles the UI).Example
The test above generates an EXC_BAD_ACCESS exception. Which usually means a segmentation fault / memory access problem of some sort.
I'll paste the details of the call stack and point out the failing line of each step as I got them from the debugger. the whole call stack is rather long and is in the last section of this issue.
Detailed call stack
217 0x0000000106508d58 in zcashlc::zcashlc_create_toaddress::$u7b$$u7b$closure$u7d$$u7d$::h6f230735200671fd at /rust/src/lib.rs:477
#216 0x00000001064ecad1 in zcash_client_sqlite::transact::create_to_address::hfc5c1773697090ef at .cargo/git/checkouts/librustzcash-62184a2f30b52083/9e659d6/zcash_client_sqlite/src/transact.rs:230
#215 0x000000010651cd98 in zcash_primitives::transaction::builder::Builder$LT$R$GT$::build::h2bfb3d78c2445c76 at .cargo/git/checkouts/librustzcash-62184a2f30b52083/9e659d6/zcash_primitives/src/transaction/builder.rs:425
#214 0x00000001065f75e6 in _$LT$zcash_proofs..prover..LocalTxProver$u20$as$u20$zcash_primitives..prover..TxProver$GT$::spend_proof::h7dd2929c93463fdd at .cargo/git/checkouts/librustzcash-62184a2f30b52083/9e659d6/zcash_proofs/src/prover.rs:139
#213 0x00000001065eb69d in zcash_proofs::sapling::prover::SaplingProvingContext::spend_proof::h17af854df68883c4 at .cargo/git/checkouts/librustzcash-62184a2f30b52083/9e659d6/zcash_proofs/src/sapling/prover.rs:127
call stack: