-
Notifications
You must be signed in to change notification settings - Fork 624
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
Fix concurrency issue when accessing C2TC #1282
Conversation
This bytearray was mutating itself during the init phase. By moving it to an object, the init {} deals with the initialization and makes it thread safe. The same logic was used for ESCAPE_2_CHAR.
We do not have the |
@sandwwraith yes, this PR fixes the issue. Testing on the 1.0.1 without this patch leads to a sigsev, applying this patch solves the issue. Ok for the tests |
I'm unable to reproduce it from the nativeTests, however from an external Rust caller (I guess in C it will be the same), it's systematic. Would it be enough if I provide you with the Rust code to reproduce it? |
Thanks, but I guess we are good without Rust code in the codebase :) Thank you for your contribution, I'll catch it up from here and will adjust the Gradle script to run tests both in the background and in main K/N thread and will update the PR |
Closing in the favor of #1301 |
Update: this problem couldn't be reproduced with |
Oh!
Glad you found why it's not easy to reproduce from K/N!
…On Wed, Jan 20, 2021 at 4:45 PM Vsevolod Tolstopyatov < ***@***.***> wrote:
Update: this problem couldn't be reproduced with nativeTest because K/N
runtime ensures all globals are initialized *before* main entry point.
But it isn't the case for external callers and Obj-C frameworks
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1282 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACCABWS422J5UQ6UNKUCE3S233DBANCNFSM4V2IWXAA>
.
--
Mohamed Zenadi
|
This ByteArray was mutating itself during the init phase. By moving it to an object, the init {} deals with the initialization and makes it thread safe. The same logic was used for ESCAPE_2_CHAR.
Fixes #1279