Skip to content
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

[SR-15890] [Concurrency] swift_task_alloc crashes on Linux Armv7 #58151

Closed
colemancda opened this issue Feb 19, 2022 · 10 comments
Closed

[SR-15890] [Concurrency] swift_task_alloc crashes on Linux Armv7 #58151

colemancda opened this issue Feb 19, 2022 · 10 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@colemancda
Copy link
Contributor

Previous ID SR-15890
Radar None
Original Reporter @colemancda
Type Bug
Status In Progress
Resolution
Environment

Swift 5.5.3 StdLib cross compiled for Armv7 (Debian 11)

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee @colemancda
Priority Medium

md5: 7bf4f333a4be27a31c1af5ff268782fd

Issue Description:

Swift concurrency is crashing on 32-bit ARM.

@colemancda
Copy link
Contributor Author

Script to build for Debian 11 Armv7

Hello, world!
Will throw
Task ran
Segmentation fault

(LLDB)
Process 196075 launched: '/usr/local/bin/hello' (arm)
Hello, world!
Will throw
Task ran
Bye
Process 196075 stopped

(lldb) thread backtrace

@colemancda
Copy link
Contributor Author

Attaching build environment and diagnostic messages.

OS: Debian GNU/Linux bookworm/sid aarch64

Host: MediaTek krane sku176 board

Kernel: 5.17.0-rc3-cadmium

CPU: (8) @ 1.989GHz

Memory: 1766MiB / 3891MiB

Linux lenovo-duet 5.17.0-rc3-cadmium #1 SMP PREEMPT Fri Feb 11 00:51:25 PST 2022 aarch64 GNU/Linux

@colemancda
Copy link
Contributor Author

This is the output when running via `qemu-arm-static` with concurrency debug logs enabled in a Debian 11 VM on MacBook Pro (M1 Pro)

coleman@macbook-linux:~/Developer/buildroot$ sudo chroot ~/Developer/buildroot/output/target /usr/bin/qemu-arm-static /usr/bin/hello
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x400620a0, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x400620a0 with parent (nil)
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x3ffff5c0] Constructing VoucherManager
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x400620a0)
[999167600] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x400620a0->flagAsRunning()
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x3ffff5c0] Swapping jobs to 0x400620a0
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x3ffff5c0] Swapping jobs to 0x400620a0, adopting voucher (nil)
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x3ffff5c0] Saved original voucher (nil)
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor 0x3dcd6540 to 0x3dcd6540
Hello, world!
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x40062f90, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x40062f90 with parent (nil)
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x40062f90 on executor (nil)
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x3a6fd860] Constructing VoucherManager
[980411248] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x40062f90)
[980411248] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x40062f90->flagAsRunning()
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x3a6fd860] Swapping jobs to 0x40062f90
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x3a6fd860] Swapping jobs to 0x40062f90, adopting voucher (nil)
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x3a6fd860] Saved original voucher (nil)
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x40063288, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x40063288 with parent (nil)
[999167600] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x400620a0->flagAsSuspended()
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0x3ffff5c0] Restoring voucher on task 0x400620a0
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0x3ffff5c0] Leaving empty VoucherManager
Will throw
[980411248] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor (nil) to 0x3dcd6540
[980411248] [../stdlib/public/Concurrency/Actor.cpp:1887](swift_task_switchImpl) switch failed, task 0x40062f90 enqueued on executor 0x3dcd6540
[980411248] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x40062f90->flagAsSuspended()
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0x3a6fd860] Restoring voucher on task 0x40062f90
[980411248] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x40062f90 on executor 0x3dcd6540
[980411248] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0x3a6fd860] Leaving empty VoucherManager
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x392fe268] Constructing VoucherManager
[959443824] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x40062f90)
[959443824] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x40062f90->flagAsRunning()
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x392fe268] Swapping jobs to 0x40062f90
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x392fe268] Swapping jobs to 0x40062f90, adopting voucher (nil)
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x392fe268] Saved original voucher (nil)
Task ran
[959443824] [../stdlib/public/Concurrency/Task.cpp:328](completeTaskImpl) task 0x40062f90 completed
[959443824] [../stdlib/public/Concurrency/Task.cpp:161](completeFuture) complete future = 0x40062f90
[959443824] [../stdlib/public/Concurrency/Task.cpp:198](completeFuture) task 0x40062f90 had no waiting tasks
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:46](leave) [0x392fe268] Restoring original voucher (nil)
[969929584] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x39cfe1e0] Constructing VoucherManager
[969929584] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x40063288)
[969929584] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x40063288->flagAsRunning()
[969929584] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x39cfe1e0] Swapping jobs to 0x40063288
[969929584] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x39cfe1e0] Swapping jobs to 0x40063288, adopting voucher (nil)
[969929584] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x39cfe1e0] Saved original voucher (nil)
[969929584] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x400620a0 on executor (nil)
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x3b8dd860] Constructing VoucherManager
[999154544] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x400620a0)
[999154544] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x400620a0->flagAsRunning()
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x3b8dd860] Swapping jobs to 0x400620a0
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x3b8dd860] Swapping jobs to 0x400620a0, adopting voucher (nil)
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x3b8dd860] Saved original voucher (nil)
[969929584] [../stdlib/public/Concurrency/Task.cpp:328](completeTaskImpl) task 0x40063288 completed
[969929584] [../stdlib/public/Concurrency/Task.cpp:161](completeFuture) complete future = 0x40063288
[969929584] [../stdlib/public/Concurrency/Task.cpp:198](completeFuture) task 0x40063288 had no waiting tasks
[969929584] [../stdlib/public/Concurrency/TaskPrivate.h:432](flagAsCompleted) task completed 0x40063288
[999154544] [../stdlib/public/Concurrency/TaskStatus.cpp:358](swift_task_removeStatusRecordImpl) remove status record = 0x40062350, from current task = 0x400620a0
[999154544] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor (nil) to 0x3dcd6540
[999154544] [../stdlib/public/Concurrency/Actor.cpp:1887](swift_task_switchImpl) switch failed, task 0x400620a0 enqueued on executor 0x3dcd6540
[999154544] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x400620a0->flagAsSuspended()
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0x3b8dd860] Restoring voucher on task 0x400620a0
[999154544] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x400620a0 on executor 0x3dcd6540
[999154544] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0x3b8dd860] Leaving empty VoucherManager
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x392fe268] Constructing VoucherManager
[959443824] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x400620a0)
[959443824] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x400620a0->flagAsRunning()
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x392fe268] Swapping jobs to 0x400620a0
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x392fe268] Swapping jobs to 0x400620a0, adopting voucher (nil)
[959443824] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x392fe268] Saved original voucher (nil)
[959443824] [../stdlib/public/Concurrency/TaskPrivate.h:432](flagAsCompleted) task completed 0x40062f90
[959443824] [../stdlib/public/Concurrency/Task.cpp:255](destroyTask) destroy task 0x40062f90
[959443824] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor 0x3dcd6540 to 0x3dcd6540

coleman@macbook-linux:~/Developer/buildroot$ sudo chroot ~/Developer/buildroot/output/target /usr/bin/qemu-arm-static /usr/bin/hello
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x400620a0, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x400620a0 with parent (nil)
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0x3ffff5c0] Constructing VoucherManager
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x400620a0)
[999167600] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x400620a0->flagAsRunning()
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0x3ffff5c0] Swapping jobs to 0x400620a0
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0x3ffff5c0] Swapping jobs to 0x400620a0, adopting voucher (nil)
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0x3ffff5c0] Saved original voucher (nil)
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor 0x3dcd6540 to 0x3dcd6540
Hello, world!
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x40062f90, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x40062f90 with parent (nil)
[999167600] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x40062f90 on executor (nil)
[999167600] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x40063288, parent = (nil), slab 512
[999167600] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x40063288 with parent (nil)
[999167600] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x400620a0->flagAsSuspended()
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0x3ffff5c0] Restoring voucher on task 0x400620a0
[999167600] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0x3ffff5c0] Leaving empty VoucherManager
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction

@colemancda
Copy link
Contributor Author

[3070162544] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x1c280a0, parent = (nil), slab 512

[3070162544] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x1c280a0 with parent (nil)

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xbe8bfba0] Constructing VoucherManager

[3070162544] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c280a0)

[3070162544] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c280a0->flagAsRunning()

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xbe8bfba0] Swapping jobs to 0x1c280a0

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xbe8bfba0] Swapping jobs to 0x1c280a0, adopting voucher (nil)

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xbe8bfba0] Saved original voucher (nil)

[3070162544] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor 0xb54d0540 to 0xb54d0540

Hello, world!

[3070162544] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x1c28f78, parent = (nil), slab 512

[3070162544] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x1c28f78 with parent (nil)

[3070162544] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x1c28f78 on executor (nil)

[3070162544] [../stdlib/public/Concurrency/Task.cpp:567](swift_task_create_commonImpl) allocate task 0x1c29288, parent = (nil), slab 512

[3070162544] [../stdlib/public/Concurrency/Task.cpp:646](swift_task_create_commonImpl) creating task 0x1c29288 with parent (nil)

[3070162544] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x1c280a0->flagAsSuspended()

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0xbe8bfba0] Restoring voucher on task 0x1c280a0

[3070162544] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0xbe8bfba0] Leaving empty VoucherManager

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xb30dd860] Constructing VoucherManager

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c28f78)

[3004031856] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c28f78->flagAsRunning()

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xb30dd860] Swapping jobs to 0x1c28f78

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xb30dd860] Swapping jobs to 0x1c28f78, adopting voucher (nil)

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xb30dd860] Saved original voucher (nil)

Will throw

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor (nil) to 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1887](swift_task_switchImpl) switch failed, task 0x1c28f78 enqueued on executor 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x1c28f78->flagAsSuspended()

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0xb30dd860] Restoring voucher on task 0x1c28f78

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x1c28f78 on executor 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0xb30dd860] Leaving empty VoucherManager

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xb14fe268] Constructing VoucherManager

[2974806896] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c28f78)

[2974806896] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c28f78->flagAsRunning()

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xb14fe268] Swapping jobs to 0x1c28f78

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xb14fe268] Swapping jobs to 0x1c28f78, adopting voucher (nil)

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xb14fe268] Saved original voucher (nil)

Task ran

[2974806896] [../stdlib/public/Concurrency/Task.cpp:328](completeTaskImpl) task 0x1c28f78 completed

[2974806896] [../stdlib/public/Concurrency/Task.cpp:161](completeFuture) complete future = 0x1c28f78

[2974806896] [../stdlib/public/Concurrency/Task.cpp:198](completeFuture) task 0x1c28f78 had no waiting tasks

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:46](leave) [0xb14fe268] Restoring original voucher (nil)

[2995639152] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xb28dc1e0] Constructing VoucherManager

[2995639152] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c29288)

[2995639152] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c29288->flagAsRunning()

[2995639152] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xb28dc1e0] Swapping jobs to 0x1c29288

[2995639152] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xb28dc1e0] Swapping jobs to 0x1c29288, adopting voucher (nil)

[2995639152] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xb28dc1e0] Saved original voucher (nil)

[2995639152] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x1c280a0 on executor (nil)

[2995639152] [../stdlib/public/Concurrency/Task.cpp:328](completeTaskImpl) task 0x1c29288 completed

[2995639152] [../stdlib/public/Concurrency/Task.cpp:161](completeFuture) complete future = 0x1c29288

[2995639152] [../stdlib/public/Concurrency/Task.cpp:198](completeFuture) task 0x1c29288 had no waiting tasks

[2995639152] [../stdlib/public/Concurrency/TaskPrivate.h:432](flagAsCompleted) task completed 0x1c29288

[2995639152] [../stdlib/public/Concurrency/Task.cpp:255](destroyTask) destroy task 0x1c29288

[2995639152] [../stdlib/public/Concurrency/VoucherSupport.h:46](leave) [0xb28dc1e0] Restoring original voucher (nil)

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xb30dd860] Constructing VoucherManager

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c280a0)

[3004031856] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c280a0->flagAsRunning()

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xb30dd860] Swapping jobs to 0x1c280a0

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xb30dd860] Swapping jobs to 0x1c280a0, adopting voucher (nil)

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xb30dd860] Saved original voucher (nil)

[3004031856] [../stdlib/public/Concurrency/TaskStatus.cpp:358](swift_task_removeStatusRecordImpl) remove status record = 0x1c28350, from current task = 0x1c280a0

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor (nil) to 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1887](swift_task_switchImpl) switch failed, task 0x1c280a0 enqueued on executor 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/TaskPrivate.h:399](flagAsSuspended) 0x1c280a0->flagAsSuspended()

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:103](restoreVoucher) [0xb30dd860] Restoring voucher on task 0x1c280a0

[3004031856] [../stdlib/public/Concurrency/Actor.cpp:1907](swift_task_enqueueImpl) enqueue job 0x1c280a0 on executor 0xb54d0540

[3004031856] [../stdlib/public/Concurrency/VoucherSupport.h:55](leave) [0xb30dd860] Leaving empty VoucherManager

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:36](VoucherManager) [0xb14fe268] Constructing VoucherManager

[2974806896] [../stdlib/public/Concurrency/Actor.cpp:1458](swift_job_runImpl) swift_job_runImpl(0x1c280a0)

[2974806896] [../stdlib/public/Concurrency/TaskPrivate.h:369](flagAsRunning) 0x1c280a0->flagAsRunning()

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:65](swapToJob) [0xb14fe268] Swapping jobs to 0x1c280a0

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:73](swapToJob) [0xb14fe268] Swapping jobs to 0x1c280a0, adopting voucher (nil)

[2974806896] [../stdlib/public/Concurrency/VoucherSupport.h:91](swapToJob) [0xb14fe268] Saved original voucher (nil)

[2974806896] [../stdlib/public/Concurrency/TaskPrivate.h:432](flagAsCompleted) task completed 0x1c28f78

[2974806896] [../stdlib/public/Concurrency/Task.cpp:255](destroyTask) destroy task 0x1c28f78

[2974806896] [../stdlib/public/Concurrency/Actor.cpp:1850](swift_task_switchImpl) trying to switch from executor 0xb54d0540 to 0xb54d0540

@colemancda
Copy link
Contributor Author

The issue is not present when building the Std Lib in `Debug` mode, only when building in `Release` with cmake.

@colemancda
Copy link
Contributor Author

[3069515376] [../stdlib/public/Concurrency/Task.cpp:567] allocate task 0x1ea8888, parent = (nil), slab 512

[3069515376] [../stdlib/public/Concurrency/Task.cpp:646] creating task 0x1ea8888 with parent (nil)

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xbec83bbc] Constructing VoucherManager

[3069515376] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea8888)

[3069515376] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea8888->flagAsRunning()

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xbec83bbc] Swapping jobs to 0x1ea8888

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xbec83bbc] Swapping jobs to 0x1ea8888, adopting voucher (nil)

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xbec83bbc] Saved original voucher (nil)

[3069515376] [../stdlib/public/Concurrency/Actor.cpp:1850] trying to switch from executor 0xb6083100 to 0xb6083100

Hello, world!

[3069515376] [../stdlib/public/Concurrency/Task.cpp:567] allocate task 0x1ea9388, parent = (nil), slab 512

[3069515376] [../stdlib/public/Concurrency/Task.cpp:646] creating task 0x1ea9388 with parent (nil)

[3069515376] [../stdlib/public/Concurrency/Actor.cpp:1907] enqueue job 0x1ea9388 on executor (nil)

[3069515376] [../stdlib/public/Concurrency/Task.cpp:567] allocate task 0x1ea96a8, parent = (nil), slab 512

[3069515376] [../stdlib/public/Concurrency/Task.cpp:646] creating task 0x1ea96a8 with parent (nil)

[3069515376] [../stdlib/public/Concurrency/TaskPrivate.h:399] 0x1ea8888->flagAsSuspended()

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:103] [0xbec83bbc] Restoring voucher on task 0x1ea8888

[3069515376] [../stdlib/public/Concurrency/VoucherSupport.h:55] [0xbec83bbc] Leaving empty VoucherManager

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xb3cc2c0c] Constructing VoucherManager

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea9388)

[3016504176] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea9388->flagAsRunning()

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xb3cc2c0c] Swapping jobs to 0x1ea9388

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xb3cc2c0c] Swapping jobs to 0x1ea9388, adopting voucher (nil)

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xb3cc2c0c] Saved original voucher (nil)

Will throw

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1850] trying to switch from executor (nil) to 0xb6083100

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1887] switch failed, task 0x1ea9388 enqueued on executor 0xb6083100

[3016504176] [../stdlib/public/Concurrency/TaskPrivate.h:399] 0x1ea9388->flagAsSuspended()

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:103] [0xb3cc2c0c] Restoring voucher on task 0x1ea9388

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1907] enqueue job 0x1ea9388 on executor 0xb6083100

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:55] [0xb3cc2c0c] Leaving empty VoucherManager

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xb18fdb5c] Constructing VoucherManager

[2978997104] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea9388)

[2978997104] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea9388->flagAsRunning()

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xb18fdb5c] Swapping jobs to 0x1ea9388

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xb18fdb5c] Swapping jobs to 0x1ea9388, adopting voucher (nil)

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xb18fdb5c] Saved original voucher (nil)

Task ran

[2978997104] [../stdlib/public/Concurrency/Task.cpp:328] task 0x1ea9388 completed

[2978997104] [../stdlib/public/Concurrency/Task.cpp:161] complete future = 0x1ea9388

[2978997104] [../stdlib/public/Concurrency/Task.cpp:198] task 0x1ea9388 had no waiting tasks

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:46] [0xb18fdb5c] Restoring original voucher (nil)

[3008111472] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xb34c1b24] Constructing VoucherManager

[3008111472] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea96a8)

[3008111472] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea96a8->flagAsRunning()

[3008111472] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xb34c1b24] Swapping jobs to 0x1ea96a8

[3008111472] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xb34c1b24] Swapping jobs to 0x1ea96a8, adopting voucher (nil)

[3008111472] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xb34c1b24] Saved original voucher (nil)

[3008111472] [../stdlib/public/Concurrency/Actor.cpp:1907] enqueue job 0x1ea8888 on executor (nil)

[3008111472] [../stdlib/public/Concurrency/Task.cpp:328] task 0x1ea96a8 completed

[3008111472] [../stdlib/public/Concurrency/Task.cpp:161] complete future = 0x1ea96a8

[3008111472] [../stdlib/public/Concurrency/Task.cpp:198] task 0x1ea96a8 had no waiting tasks

[3008111472] [../stdlib/public/Concurrency/TaskPrivate.h:432] task completed 0x1ea96a8

[3008111472] [../stdlib/public/Concurrency/Task.cpp:255] destroy task 0x1ea96a8

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xb3cc2c0c] Constructing VoucherManager

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea8888)

[3016504176] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea8888->flagAsRunning()

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xb3cc2c0c] Swapping jobs to 0x1ea8888

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xb3cc2c0c] Swapping jobs to 0x1ea8888, adopting voucher (nil)

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xb3cc2c0c] Saved original voucher (nil)

[3016504176] [../stdlib/public/Concurrency/TaskStatus.cpp:358] remove status record = 0x1ea8ec0, from current task = 0x1ea8888

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1850] trying to switch from executor (nil) to 0xb6083100

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1887] switch failed, task 0x1ea8888 enqueued on executor 0xb6083100

[3016504176] [../stdlib/public/Concurrency/TaskPrivate.h:399] 0x1ea8888->flagAsSuspended()

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:103] [0xb3cc2c0c] Restoring voucher on task 0x1ea8888

[3016504176] [../stdlib/public/Concurrency/Actor.cpp:1907] enqueue job 0x1ea8888 on executor 0xb6083100

[3016504176] [../stdlib/public/Concurrency/VoucherSupport.h:55] [0xb3cc2c0c] Leaving empty VoucherManager

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:36] [0xb18fdb5c] Constructing VoucherManager

[2978997104] [../stdlib/public/Concurrency/Actor.cpp:1458] swift_job_runImpl(0x1ea8888)

[2978997104] [../stdlib/public/Concurrency/TaskPrivate.h:369] 0x1ea8888->flagAsRunning()

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:65] [0xb18fdb5c] Swapping jobs to 0x1ea8888

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:73] [0xb18fdb5c] Swapping jobs to 0x1ea8888, adopting voucher (nil)

[2978997104] [../stdlib/public/Concurrency/VoucherSupport.h:91] [0xb18fdb5c] Saved original voucher (nil)

Segmentation fault (core dumped)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@colemancda
Copy link
Contributor Author

colemancda commented May 27, 2022

Process 600680 launched: '/home/coleman/Developer/swift-armv7/build/swift-hello/armv7-unknown-linux-gnueabihf/debug/swift-hello' (arm)
swift-hello: /home/coleman/Developer/swift-armv7/downloads/swift-swift-5.6.1-RELEASE/stdlib/public/Concurrency/../runtime/StackAllocator.h:291: void *swift::StackAllocator<1000, &swift::TaskAllocatorSlabMetadata>::alloc(size_t) [SlabCapacity = 1000, SlabMetadataPtr = &swift::TaskAllocatorSlabMetadata]: Assertion `llvm::isAddrAligned(llvm::Align(alignment), allocation->getAllocatedMemory())' failed.
This version of LLDB has no plugin for the mipsassem language. Inspection of frame variables will be limited.
Process 600680 stopped
* thread #1, name = 'swift-hello', stop reason = signal SIGABRT
    frame #0: 0xf670bc66 libc.so.6`__libc_do_syscall at libc-do-syscall.S:47
(lldb) thread backtrace'
error: unknown command shorthand suffix: '''
(lldb) thread backtrace
* thread #1, name = 'swift-hello', stop reason = signal SIGABRT
  * frame #0: 0xf670bc66 libc.so.6`__libc_do_syscall at libc-do-syscall.S:47
    frame #1: 0xf671aea0 libc.so.6`__GI_raise at internal-signals.h:86:3
    frame #2: 0xf671ae90 libc.so.6`__GI_raise(sig=<unavailable>) at raise.c:48
    frame #3: 0xf670b7a2 libc.so.6`__GI_abort at abort.c:79:7
    frame #4: 0xf6716140 libc.so.6`__assert_fail_base(fmt="", assertion="llvm::isAddrAligned(llvm::Align(alignment), allocation->getAllocatedMemory())", file=0x00000000, line=291, function="void *swift::StackAllocator<1000, &swift::TaskAllocatorSlabMetadata>::alloc(size_t) [SlabCapacity = 1000, SlabMetadataPtr = &swift::TaskAllocatorSlabMetadata]") at assert.c:92:3
    frame #5: 0xf67161ca libc.so.6`__GI___assert_fail(assertion=0x00000000, file="", line=291, function="") at assert.c:101:3
    frame #6: 0xf76814c0 libswift_Concurrency.so`swift::StackAllocator<1000u, &(swift::TaskAllocatorSlabMetadata)>::alloc(this=0x004643d0, size=36) at StackAllocator.h:290:5
    frame #7: 0xf768131a libswift_Concurrency.so`::swift_task_alloc(size=32) at TaskAlloc.cpp:51:45
    frame #8: 0x0043941c swift-hello`$sIetH_yts5Error_pIegHrzo_TRTA at <compiler-generated>:0
    frame #9: 0xf7675e66 libswift_Concurrency.so`swift::runJobInEstablishedExecutorContext(job=0x004643a0) at Actor.cpp:238:11
    frame #10: 0xf7676860 libswift_Concurrency.so`swift_job_runImpl(job=0x004643a0, executor=ExecutorRef @ 0xfffef4c0) at Actor.cpp:1488:3
    frame #11: 0xf767681e libswift_Concurrency.so`::swift_job_run(job=0x004643a0, executor=ExecutorRef @ 0xfffef4e0) at CompatibilityOverrideConcurrency.def:76:1
    frame #12: 0x00439308 swift-hello`main at Hello.swift:0
    frame #13: 0xf670ba20 libc.so.6`__libc_start_main(main=(swift-hello`main), argc=1, argv=0xfffef664, init=<unavailable>, fini=(swift-hello`__libc_csu_fini + 1), rtld_fini=(ld-2.31.so`_dl_fini + 1 at dl-fini.c:30:1), stack_end=0xfffef664) at libc-start.c:308:16
    frame #14: 0x004373ac swift-hello`_start + 52

@colemancda
Copy link
Contributor Author

@buttaface is this reproducible on Android? It's only reproducible for me with debug builds on Swift 5.5 - 5.6.

@finagolfin
Copy link
Contributor

I don't build the debug stdlib for armv7 unless I'm debugging something in particular, which I haven't been lately. I will build it and let you know.

@colemancda
Copy link
Contributor Author

colemancda commented Nov 6, 2022

Not reproducible with Swift 5.7.1 built with -RA or --debug-swift-stdlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants