-
Notifications
You must be signed in to change notification settings - Fork 24
Conversation
@@ -97,9 +97,7 @@ public actual class CoroutineWorker internal actual constructor() { | |||
repeatedlyCheckForCancellation(this.coroutineContext, cancelled) { completed } | |||
// inside of a new CoroutineScope, so that child jobs are cancelled | |||
coroutineScope { | |||
autoreleasepool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benasher44 , any thoughts on this?
If we use the autorelease pool we end up with a test failure on withContext_across_threads
.
objc[14264]: Invalid or prematurely-freed autorelease pool 0x7fd7dc80c048.
Child process terminated with signal 6: Abort trap
I'm uncertain why it is either invalid or prematurely freed, but I also don't know that we need the release pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'll do some research and get back to you! We need an autoreleasepool since this is a thread managed by us (and not GCD, for example)—might just be some changes in 1.6.x that we need to take into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielRBaird actually can you make a test that reproduces it, possibly? I'm surprised all tests have passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they pass with the autorelease pool removed like I did here. If you undo this change it will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Can you put it back? I'd like to open a KT ticket with the failure. This is prob a K/N bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay according to the ticket, we can just remove this. This was added in #56, which predates Kotlin 1.4 (autoreleasepools added to Worker in 1.4.30)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. I'll do that. Thanks for helping investigate!
No description provided.