Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Transaction::rollback() fails with assertion #5624

Closed
sync-by-unito bot opened this issue Jun 28, 2022 · 8 comments
Closed

Calling Transaction::rollback() fails with assertion #5624

sync-by-unito bot opened this issue Jun 28, 2022 · 8 comments
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Jun 28, 2022

This is an umbrella issue used to track the resolution of several issues we have seen including "Transaction::rollback" in the  stack trace. These are (please update if more are found):
#5585
https://github.com/realm/realm-swift/issues/7788 (now closed)

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Jun 28, 2022

➤ On 2022-06-24, Jørgen Edelbo commented:

One theory could be that the call to "remap_and_update_refs" in Transaction::commit_and_continue_as_read could throw. If this happens we could get a stacktrace like the ones we have seen. I tried to create a test where I forced the function to throw and then I got this trace:

#4 0x00005555564abb84 in realm::util::terminate (message=0x55555676ed50 "Assertion failed: m_write_transaction_open",
file=0x55555676e2c0 "/home/jed/wip/realm-mono/src/realm/db.cpp", line=2091, values=...) at /home/jed/wip/realm-mono/src/realm/util/terminate.cpp:133
#5 0x00005555563390c2 in realm::DB::do_end_write (this=0x555556c9f220) at /home/jed/wip/realm-mono/src/realm/db.cpp:2091
#6 0x000055555633b9cc in realm::DB::end_write_on_correct_thread (this=0x555556c9f220) at /home/jed/wip/realm-mono/src/realm/db.cpp:2570
#7 0x000055555643dc71 in realm::Transaction::rollback (this=0x555556c990a0) at /home/jed/wip/realm-mono/src/realm/transaction.cpp:186
#8 0x000055555643d929 in realm::Transaction::close (this=0x555556c990a0) at /home/jed/wip/realm-mono/src/realm/transaction.cpp:126

This will effectively hide the underlying exception. The PR #5615 updates the transaction stage earlier so that this assertion will not fail.

I don't believe that this is the root cause, but the PR will rule it out.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Jun 28, 2022

➤ On 2022-06-24, Jørgen Edelbo commented:

I think the main question to ask is: How can it be that the transaction is still in writing stage after the call to "commit_and_continue_as_read"? It must be in writing stage, otherwise the rollback function would not be called when the transaction object is closed when going out of scope.

@jedelbo
Copy link
Contributor

jedelbo commented Jun 28, 2022

Links in GitHub:
#5585
realm/realm-swift#7788

@sync-by-unito sync-by-unito bot assigned finnschiermer and unassigned jedelbo Jun 28, 2022
@sync-by-unito sync-by-unito bot closed this as completed Jul 11, 2022
@sync-by-unito
Copy link
Author

sync-by-unito bot commented Jul 11, 2022

➤ Finn Andersen commented:

We have merged #5615 so when released, these failed rollbacks should go away.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 5, 2022

➤ Lee Maguire commented:

It looks like this issue has resurfaced after the fix was merged https://jira.mongodb.org/browse/HELP-36253

@leemaguire leemaguire reopened this Aug 5, 2022
@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 5, 2022

➤ Jørgen Edelbo commented:

[~lee.maguire@mongodb.com] the fix that Finn mentioned was not released in Swift until 10.28.4

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 10, 2022

➤ Finn Andersen commented:

Yeah, we should close this unless it is reported on a newer release.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented Aug 26, 2022

➤ Finn Andersen commented:

Closing as presumably fixed

@sync-by-unito sync-by-unito bot closed this as completed Aug 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants