-
Notifications
You must be signed in to change notification settings - Fork 35
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
SIGSEGV on MacOS #11
Comments
Ah, I've tested it now with |
That would be great, since I'm not much of a macOS developer either. It's probably also a good idea to check why exactly this is crashing, rather than just putting an RwLock on it without having a clear understanding of what exactly is going wrong. |
Fair enough, the PR was a bit premature :) According to https://developer.apple.com/documentation/appkit/nspasteboard there is a general pasteboard that is shared by all applications. I'm not sure how the release works (when the |
I don't know how it works, sure it could be. However this needs to work cross-application too, so that would mean that if I free something in my application while you try to read in your application, it would segfault, which seems unlikely? Unless I understood you incorrectly. |
I meant I was wondering that maybe |
According to this SO thread and Apple documentation on the topic, in Cocoa, "mutable objects are generally not thread-safe". I think this justifies putting the I don't think
|
I suspect the proper solution here is to only access the |
I'm seeing crashes on MacOS Catalina (10.15.3) with Rust 1.43.1. This happens in the original clipboard crate as well, but since that seems unmaintained I'm reporting it here.
You can reproduce the crash by running
cargo test
in my fork.You may need to run it a few times, but you will get different errors such as:
Or:
I'm unfortunately no MacOS developer so I have no idea what causes this, but it only seems to occur when I'm accessing the clipboard from both my test code and my regular (under test) code, like in
some_other_fn
in the code below. Moving theClipboardContext
to a shared static using something likelazy_static!
does not help.The test is fairly simple:
The text was updated successfully, but these errors were encountered: