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

Installing the Static Linux SDK on Linux segfaults intermittently #8171

Open
1 task done
euanh opened this issue Dec 11, 2024 · 3 comments
Open
1 task done

Installing the Static Linux SDK on Linux segfaults intermittently #8171

euanh opened this issue Dec 11, 2024 · 3 comments
Labels

Comments

@euanh
Copy link
Contributor

euanh commented Dec 11, 2024

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

swift-container-plugin's CI has a scheduled GitHub Action which installs the Static Linux SDK in an Ubuntu VM and uses it to build some example projects. This job fails intermittently with a segmentation fault. The scheduled job has only been running for a couple of days, but I also saw this problem once while working on the CI job so it has happened at least twice. The earlier failure log seems to have been lost because I re-ran the job.

I have not yet reproduced this issue in a local Linux machine, and I have never seen it on macOS.

Expected behavior

The SDK should install successfully.

Actual behavior

The SDK install sometimes segfaults:
https://github.com/apple/swift-container-plugin/actions/runs/12269075412/job/34232032783

swift sdk install \
      https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz \
      --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075
  shell: /usr/bin/bash -e {0}
Downloading a Swift SDK bundle archive from `[https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz`...](https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz%60...)
Downloading
0%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
6%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
10%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
17%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
19%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
21%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
23%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
24%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
31%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
32%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
32%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
34%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
34%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
36%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
37%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
39%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
43%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
44%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
46%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
48%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
49%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
50%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
51%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
54%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
56%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
59%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
64%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
68%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
70%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
74%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
77%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
80%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
83%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
85%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
91%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
97%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz
100%: Downloading swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz

*** Signal 11: Backtracing from 0x7fea7869af5e... done ***

*** Program crashed: Bad pointer dereference at 0x0000000000000018 ***

Thread 0 "swift-sdk":

0  0x00007fea7864280a <unknown> in libc.so.6

Thread 1:

0  0x00007fea78725e2e <unknown> in libc.so.6

Thread 2 crashed:

0  0x00007fea7869af5e <unknown> in libc.so.6

Thread 3:

0  0x000055f79c0b8c40 llbuild::buildsystem::BuildSystemExtensionManager::~BuildSystemExtensionManager() in swift-package at /home/build-user/llbuild/lib/BuildSystem/include/llbuild/BuildSystem/BuildSystemExtensions.h:33

Thread 4:

0  0x00007fea78691117 <unknown> in libc.so.6

Thread 5:

0  0x00007fea78691117 <unknown> in libc.so.6


Registers:

rax 0x00000000ffffffff  4294967295
rdx 0x00007fea60199910  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ················
rcx 0x00007fea75c40588  00 00 00 00 00 00 00 00 03 00 00 00 05 00 00 00  ················
rbx 0x0000000092a74dfd  2460438013
rsi 0x0000000000000000  0
rdi 0x0000000000000011  17
rbp 0x00000000ffffffff  4294967295
rsp 0x00007fea6bffde30  09 00 00 00 00 00 00 00 10 99 19 60 ea 7f 00 00  ···········`ê···
 r8 0x0000000000000000  0
 r9 0x0000000000000000  0
r10 0x0000000000000000  0
r11 0x820de9d6dfe34264  9371403508716356196
r12 0x00007fea75b615e4  2e 2e 2f 63 72 79 70 74 6f 2f 78 35 30 39 2f 78  ../crypto/x509/x
r13 0x00007fea75c404e0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ················
r14 0x00007fea75b44f6b  2e 2e 2f 63 72 79 70 74 6f 2f 65 78 5f 64 61 74  ../crypto/ex_dat
r15 0x00007fea75c3cb10  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ················
rip 0x00007fea7869af5e  8b 57 18 64 8b 04 25 d0 02 00 00 39 c2 0f 84 c7  ·W·d··%з··9··Ç

rflags 0x0000000000010206  PF

cs 0x0033  fs 0x0000  gs 0x0000


Images (56 omitted):

0x000055f79a7bb000–0x000055f79c954818 <no build ID>                            swift-package /usr/share/swift/usr/bin/swift-package
0x00007fea78600000–0x00007fea787bc341 490fef8403240c91833978d494d39e537409b92e libc.so.6     /usr/lib/x86_64-linux-gnu/libc.so.6

Backtrace took 11.76s

/home/runner/work/_temp/a6217ede-b6bd-4e1c-a7ce-94ddb3a8b154.sh: line 3:  2013 Segmentation fault      (core dumped) swift sdk install https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075
Error: Process completed with exit code 139.

Steps to reproduce

Attempt to install the released version of the Static Linux SDK on an Ubuntu 24.04 VM in GitHub actions.

https://github.com/apple/swift-container-plugin/blob/main/.github/workflows/endtoend_tests.yml
https://github.com/apple/swift-container-plugin/actions?query=event%3Aschedule+branch%3Amain

Swift Package Manager version/commit hash

6.0.2

Swift & OS version (output of swift --version ; uname -a)

OS Version: 22.04.5 LTS
Kernel Version: 6.5.0-1025-azure
Image Version: 20241201.1.0
Swift 6.0.2

Full list of included software is at: https://github.com/actions/runner-images/blob/ubuntu22/20241201.1/images/ubuntu/Ubuntu2204-Readme.md

@euanh euanh added the bug label Dec 11, 2024
@euanh
Copy link
Contributor Author

euanh commented Dec 11, 2024

The CI runs two examples in parallel. I don't know if these run in the same underlying VM: if they do, the problem might be caused by two processes trying to install the SDK at the same time. If that is the case, SwiftPM still shouldn't segfault.

@dschaefer2
Copy link
Member

Yikes indeed.

@dschaefer2
Copy link
Member

Would also be nice if we had stack traces on Linux. Hard to see where this is crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants