Skip to content

[6.1] Frequent crashes in LLBuildProgressTracker while building swift-java on linux and swift 6.1.2 #9019

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

Open
wants to merge 1 commit into
base: release/6.1
Choose a base branch
from

Conversation

rconnell9
Copy link
Contributor

@rconnell9 rconnell9 commented Aug 13, 2025

Explanation:

(cherry picked from commit 16452e1)

Frequent crashes in LLBuildProgressTracker while building swift-java on linux and swift 6.1.2

Command is associated with a handle (pointer) that may be reclaimed when this function finishes.

Scope:

Minimal

Issues:

swiftlang/swift-java#314

Original PRs:

#8998

Risk:

Minimal. Change explicitly copies variables prior to usage in async block.
Change has been tested in main and 6.2

Testing:

Confirmed fixed in main and 6.2

…on linux and swift 6.1.2 (swiftlang#8998)

Frequent crashes in LLBuildProgressTracker while building swift-java on
linux and swift 6.1.2

> Thread 4 crashed:
>
> 0 0x00007f1559da359a swift_slowAlloc + 74 in
[libswiftCore.so](http://libswiftcore.so/)
> 1 [ra] 0x00007f1559da3877 swift_allocObject + 38 in
[libswiftCore.so](http://libswiftcore.so/)
> 2 [ra] 0x00007f1559b85571 _allocateStringStorage(codeUnitCapacity:) +
160 in [libswiftCore.so](http://libswiftcore.so/)
> 3 [ra] 0x00007f1559d03452 _StringGuts.grow(_:) + 273 in
[libswiftCore.so](http://libswiftcore.so/)
> 4 [ra] 0x00007f1559bf7e88 specialized static
String._fromUTF8Repairing(_:) + 999 in
[libswiftCore.so](http://libswiftcore.so/)
> 5 [ra] [inlined] [system] 0x000056315a96e7ef specialized
String.init<A, B>(decoding:as:) in swift-package at
//<compiler-generated>
> 6 [ra] [inlined] 0x000056315a96e7ef stringFromData(_:) in
swift-package at
/home/build-user/llbuild/products/llbuildSwift/Internals.swift:49:12
> 7 [ra] 0x000056315a96e7ef Command.name.getter + 78 in swift-package at
/home/build-user/llbuild/products/llbuildSwift/BuildSystemBindings.swift:720:20
> 8 [ra] 0x00005631593a61a2 closure swiftlang#1 in
LLBuildProgressTracker.commandProcessFinished(_:process:result:) + 33 in
swift-package at
/home/build-user/swiftpm/Sources/Build/LLBuildProgressTracker.swift:347:65
> 9 [ra] [thunk] 0x00005631592f6989 thunk for @escaping
@callee_guaranteed @sendable () -> () + 24 in swift-package at
//<compiler-generated>

Command is associated with a handle (pointer) that may be reclaimed when
this function finishes.

Do not access command attributes asynchronously

(cherry picked from commit 16452e1)
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Lgtm! I confirmed this seems to resolve our issues when we tried a nightly toolchain with the fix.

Nitpick: Pr needs to follow the template a bit more

@MaxDesiatov
Copy link
Contributor

@swift-ci test

@bkhouri bkhouri changed the title Frequent crashes in LLBuildProgressTracker while building swift-java on linux and swift 6.1.2 [6.1] Frequent crashes in LLBuildProgressTracker while building swift-java on linux and swift 6.1.2 Aug 13, 2025
@bkhouri bkhouri added the swift 6.1 Related to Swift 6.1 release branch label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
swift 6.1 Related to Swift 6.1 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants