Skip to content

Commit 8bd1352

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. (cherry picked from commit d348fd9)
1 parent ed8f295 commit 8bd1352

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
@@ -942,7 +942,7 @@ AsyncTask *swift::swift_continuation_init(ContinuationAsyncContext *context,
942942
// Set the current executor as the target executor unless there's
943943
// an executor override.
944944
if (!flags.hasExecutorOverride())
945-
context->ResumeToExecutor = swift_task_getCurrentExecutor();
945+
context->ResumeToExecutor = ExecutorRef::generic();
946946

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

0 commit comments

Comments
 (0)