-
Notifications
You must be signed in to change notification settings - Fork 8
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
Yrs crashes on Intel machines #42
Comments
Thanks for the report! I don't have an intel machine handy to be able to replicate this myself - but the stack trace definitely shows that it's marched into the Rust core library. Are you by chance able to build a local XCFramework instance off the latest The part that's causing the issue is a dependency on the main core of Yrs (the core library) at https://github.com/y-crdt/y-crdt/ - looks like that dependency is aligned at https://github.com/y-crdt/y-crdt/blob/main/yrs/Cargo.toml#L18 What I'm not 100% clear on is how to make a branch of Yrs and then depend on it locally for YSwift to test at the swift level if that would resolve the issue. I might even be worthwhile to see if you can run all the relevant code and tests in Rust on that Intel Mac, at least to see if the error is showing up and reproducible with the tests that are there. If you have the rust toolchains already installed, the quick stab-to-see-if-it-breaks would be something along the lines of:
If this is an issue with the Rust library, those tests are rather extensions and I'm hoping that their unit tests will fail on that same machine in a way that can get us closer to resolving this for you. edit: the tests (running |
/cc @Horusiath in case this rings any bells... |
The reason for using |
Thank you for your suggestions. I pulled latest main and fully recompiled the framework from the Intel machine and the crash is still there. Regarding y-crdt
|
@heckj I could make Yswift to depend on a local build of yrs by using:
Building against master didn't compile so I just checked out 0.17.4 on yrs which is the version Yswift was using. |
Updating rand to 0.8.5 fixed the issue! As @Horusiath suggested, I had to remove the feature support to |
Thank you @Horusiath! I still don't understand, though, why the Yrs tests just worked and the crash only happened in the context of Swift/Rust integration. This might mean there's something else that's not working well. In any case, updating dependencies is usually good so I hope the workaround to keep wasm compatibility is not too bad! Thank you! |
Hello, I saw that the conflicting dependency was removed from Yrs in the above commit so I wanted to try again to see if that helped. So I tried updating Yrs to 0.18.2 in Yswift but I got stuck with the subscription type changes (I think from this PR). Any ideas about how to update Yswift to the new format or when Yswift will be updated to use 0.18.2+? |
@Horusiath I just tried the push this forward myself, and saw a few errors, mostly that Branch is now private. Is there a replacement that we should be using, or should this be made public in the Yrs api?
The other error that appeared was:
I can easily pull off the lifetime arguments, but wanted to verify that this should happen. |
@heckj The errors about subscriptions I mentioned showed up after I "fixed" (not sure how reliably) the ones you are mentioning. Really cool to see that you already are pushing this forward! |
I hacked the subscriptions around and I am not hitting the crash! Trying to clean it up now and making sure it works well to see if I can share it with you. But I broke backwards compatibility by removing the |
@fbarbat Put up a PR, and we can iterate to get it in to resolve your crasher! |
Ok, let me clean it up first. There's one last issue about the undo manager I need to figure out. I had commented it out to check if the crash was still happening. Specifically, this line doesn't compile. What would be the new Yrs way of doing it? e.item.meta = delegate.call(YrsUndoEvent::new(e), e.item.meta);
|
This seemed to make the tests pass (again, I am not a rust developer so no quite sure this is right) *e.meta_mut() = delegate.call(YrsUndoEvent::new(e), *e.meta_mut()); Cleaning the PR overall now... |
Created PR! Let me know what you think. Thank you! |
resolved with #44 |
We first hit this crash in our app. In our app, we found that just the simple fact of adding or removing class to our project, would cause the crash to happen or not. 🤯 The crash would happen consistently or not for a given revision of the code base.
After doing some research, we saw that running the YSwift unit tests for Documents from an Intel MacBook Pro 15-inch, 2019, with macOS 14, also crashes. It's the same stack trace.
I tried investigating further but I didn't get far since I am not a Rust developer.
Thank you!
The text was updated successfully, but these errors were encountered: