Skip to content

Commit d348fd9

Browse files
Resume to the generic executor in the absence of an override.
Without this fix, we saw a crash involving URLSession where we'd hit assertions or corruption in the runtime in various forms: - Assertion on trying to enqueue work onto a zombie actor. - job->SchedulerPrivate being overwritten (crash in getNextJobInQueue). - *(job->SchedulerPrivate) being overwritten (crash in getAsPreprocessedJob right after call to getNextJobInQueue). I haven't been able to create a minimal crashing example yet, but manual testing shows this does fix the issue. Fixes rdar://79859254.
1 parent 0cb305c commit d348fd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/Concurrency/Task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ static AsyncTask *swift_continuation_initImpl(ContinuationAsyncContext *context,
955955
// Set the current executor as the target executor unless there's
956956
// an executor override.
957957
if (!flags.hasExecutorOverride())
958-
context->ResumeToExecutor = swift_task_getCurrentExecutor();
958+
context->ResumeToExecutor = ExecutorRef::generic();
959959

960960
// We can initialize this with a relaxed store because resumption
961961
// must happen-after this call.

0 commit comments

Comments
 (0)