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

Compacting encrypted Realms fail on some devices #763

Closed
kneth opened this issue Apr 15, 2015 · 20 comments
Closed

Compacting encrypted Realms fail on some devices #763

kneth opened this issue Apr 15, 2015 · 20 comments
Assignees
Labels

Comments

@kneth
Copy link
Contributor

kneth commented Apr 15, 2015

Version 0.89.0 of core fixes bugs in SharedGroup::compact() but we see that it fails on some Android devices (on when compacting encrypted Realms). I have been able to single step so I can see that it is SharedGroup::compact() that crashes the app. This is not a duplicate of #757 as we see the crash on an Android 4.0.4 devices (the device used by Jenkins).

See realm/realm-java#955

@tgoyne @finnschiermer @cmelchior

@kneth kneth added the T-Bug label Apr 15, 2015
@finnschiermer
Copy link
Contributor

@tgoyne: I just briefly went through SharedGroup::Compact, but didn't immediately spot the problem. Can you see any "misuse" or pieces missing in that method with regard to encryption ?

@tgoyne
Copy link
Member

tgoyne commented Apr 20, 2015

Calling rename() before end_read()/complete_detach() relies on the standard unix behavior of being able to overwrite the filesystem entry of an open file without effecting the file, so if that's not the case on some Android devices then problems wouldn't be too surprising. Otherwise there's nothing obvious.

@finnschiermer
Copy link
Contributor

@tgoyne: Wasn't this fixed by PR #805 ?

@tgoyne
Copy link
Member

tgoyne commented May 11, 2015

No, any device suffering from the problem fixed in #805 could not even open a Realm file.

@finnschiermer finnschiermer self-assigned this May 13, 2015
@finnschiermer
Copy link
Contributor

The SharedGroup must be in the attached state (or open) when compact() is called. Has this error ever been seen outside of our java testcase?

@finnschiermer
Copy link
Contributor

I'm going to make compact() assert if called in unattached state.

@kneth
Copy link
Contributor Author

kneth commented May 18, 2015

@finnschiermer Please remember that the Java binding is built with assertions disabled (it was decided a long time ago). If you think we should enable these assertions, please discuss with @timanglade and @bmunkholm.

@finnschiermer
Copy link
Contributor

hrmkay - exceptions then :-)

@kneth
Copy link
Contributor Author

kneth commented May 18, 2015

Or a return value (true if compacting was successfully, false otherwise).

@finnschiermer
Copy link
Contributor

connects to pr #832

@finnschiermer
Copy link
Contributor

turns out, I was wrong about how the binding calls compact, so the hunt continues

@finnschiermer
Copy link
Contributor

We need on-device debugging before we can make real progress.

@cmelchior
Copy link
Contributor

You have it. It is called println ;), but yes the debugging capabilities on a device are horrendously bad :(

@finnschiermer
Copy link
Contributor

just fyi we are stalling this until we have arranged for better debugging (which is almost there), so I'm unassigning myself.

@finnschiermer finnschiermer removed their assignment May 29, 2015
@bmunkholm
Copy link
Contributor

@fsa: Is this possible now?

@bmunkholm
Copy link
Contributor

Ping @finnschiermer

@finnschiermer
Copy link
Contributor

@kneth: can this be reproduced with a newer Core? I'm asking because I think it might actually have been fixed without us noticing.

@finnschiermer finnschiermer added pending and removed P1 labels Oct 6, 2015
@kneth
Copy link
Contributor Author

kneth commented Oct 6, 2015

@finnschiermer It looks like compacting a populated and encrypted Realm leave it corrupted (core version 0.93.0). I'll have to investigate a bit more to draw any conclusions.

@finnschiermer finnschiermer added P1 and removed pending labels Oct 6, 2015
@kneth
Copy link
Contributor Author

kneth commented Oct 7, 2015

Please see #1201.

@finnschiermer
Copy link
Contributor

Now fixed by #1201

@finnschiermer finnschiermer removed the P1 label Dec 17, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants