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
The same crash can't be replicated on dcrandroid, so we ruled out the dcrlibwallet getTransactions() function to be the issue, and took a closer look at the fatal error: bulkBarrierPreWrite: unaligned arguments error
We found a similar issue here golang/go#28460, it pointed to go's lack of support for unaligned pointer writes.
In order to test their solution, we replaced the logic of the dcrlibwallet getTransactions() function with the code they claimed would fix the error *(*[2]uintptr)(unsafe.Pointer(uintptr(mem) + 1)) = [2]uintptr{} but the crash still ocured, so that doesn't seem to be the same case for us so we had to keep investigating.
Here's another similar issue golang/go#29264, it pointed to The compiler rejecting too-deep types and exiting gracefully, again that doesn't seem to be the case for us
We tried calling the getTransaction in a loop when the client app launches just to see if the the user not interacting with the UI would produce a different result, but the crash still occurred.
A similar issue here https://www.gitmemory.com/issue/golang/go/46893/868749896. suggests that the issue can be solved by removing the integer as the first input to the function and putting other types first.
In our case that would be changing func (mw *MultiWallet) GetTransactionsRaw(offset, limit, txFilter int32, newestFirst bool) ([]Transaction, error) {
to func (mw *MultiWallet) GetTransactionsRaw(newestFirst bool, offset, limit, txFilter int32) ([]Transaction, error) {
but the crash still occurs.
Since the crash wasn't occurring for dcrandroid, we had reason to believe the underlying issue had to do with the way gomobile compiles for arm devices.
How to replicate?
Switch between the Overview and Transactions pages multiple times in quick successions
The text was updated successfully, but these errors were encountered:
dreacot
changed the title
app crashes while trying to fetch transactions during wallet syncing
app crashes while trying to call dcrlibwallet getTransactions() function
Aug 23, 2021
The client app crashes while switching between the Overview and Transactions pages in quick successions.
The function which causes the crash was narrowed to the dcrlibwallet
getTransactions()
function.The lines of code which triggers the crash for the Overview Page and Transaction page respectively are linked below;
Overview Page: https://github.com/planetdecred/dcrios/blob/master/Decred%20Wallet/Extensions/Dcrlibwallet.swift#L245
Transactions Page: https://github.com/planetdecred/dcrios/blob/master/Decred%20Wallet/Extensions/Dcrlibwallet.swift#L148
The crashlog can be seen below;
The crash long points to a
fatal error: bulkBarrierPreWrite: unaligned arguments
error. It also points to dcrlibwalletgetTransactions()
function (https://github.com/planetdecred/dcrlibwallet/blob/master/transactions.go#L103) which is called in the Overview and Transactions pages.Another error was observed which seemed to be related to a decoding error
This error seen above,
decode allTransactionsJson error: The data couldn’t be read because it is missing.
is triggered from https://github.com/planetdecred/dcrios/blob/master/Decred%20Wallet/Extensions/Dcrlibwallet.swift#L164The same crash can't be replicated on dcrandroid, so we ruled out the dcrlibwallet
getTransactions()
function to be the issue, and took a closer look at thefatal error: bulkBarrierPreWrite: unaligned arguments
errorWe found a similar issue here golang/go#28460, it pointed to go's lack of support for unaligned pointer writes.
In order to test their solution, we replaced the logic of the dcrlibwallet
getTransactions()
function with the code they claimed would fix the error*(*[2]uintptr)(unsafe.Pointer(uintptr(mem) + 1)) = [2]uintptr{}
but the crash still ocured, so that doesn't seem to be the same case for us so we had to keep investigating.Here's another similar issue golang/go#29264, it pointed to The compiler rejecting too-deep types and exiting gracefully, again that doesn't seem to be the case for us
We tried calling the getTransaction in a loop when the client app launches just to see if the the user not interacting with the UI would produce a different result, but the crash still occurred.
A similar issue here https://www.gitmemory.com/issue/golang/go/46893/868749896. suggests that the issue can be solved by removing the integer as the first input to the function and putting other types first.
In our case that would be changing
func (mw *MultiWallet) GetTransactionsRaw(offset, limit, txFilter int32, newestFirst bool) ([]Transaction, error) {
to
func (mw *MultiWallet) GetTransactionsRaw(newestFirst bool, offset, limit, txFilter int32) ([]Transaction, error) {
but the crash still occurs.
Since the crash wasn't occurring for dcrandroid, we had reason to believe the underlying issue had to do with the way gomobile compiles for arm devices.
How to replicate?
Switch between the Overview and Transactions pages multiple times in quick successions
The text was updated successfully, but these errors were encountered: